Skip to content

Instantly share code, notes, and snippets.

@ericmdev
Created January 7, 2017 15:05
Show Gist options
  • Save ericmdev/93da2e6fa673bd4d79a86277c47e29f5 to your computer and use it in GitHub Desktop.
Save ericmdev/93da2e6fa673bd4d79a86277c47e29f5 to your computer and use it in GitHub Desktop.
Install Python on CoreOS and configure Ansible Interpreter
#!/bin/bash
### Install Python on CoreOS
VERSIONS=${VERSIONS:-"2.7.8.10"}
mkdir -p /opt/bin
cd /opt
wget http://downloads.activestate.com/ActivePython/releases/${VERSIONS}/ActivePython-${VERSIONS}-linux-x86_64.tar.gz
tar -xzvf ActivePython-${VERSIONS}-linux-x86_64.tar.gz
mv ActivePython-${VERSIONS}-linux-x86_64 apy && cd apy && ./install.sh -I /opt/python/
ln -s /opt/python/bin/easy_install /opt/bin/easy_install
ln -s /opt/python/bin/pip /opt/bin/pip
ln -s /opt/python/bin/python /opt/bin/python
ln -s /opt/python/bin/virtualenv /opt/bin/virtualenv
# export PATH
# export PATH=/opt/python/bin:$PATH
### Configure Ansible Interpreter
# inventory/example
# [example]
# example-01 ansible_ssh_host=127.0.0.1
# [example:vars]
# ansible_ssh_user=core
# ansible_python_interpreter=/opt/python/bin/python
# ansible_connection=ssh
# ansible_ssh_port=22
# ansible_ssh_private_key_file=id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment