Skip to content

Instantly share code, notes, and snippets.

@juliendufresne
Last active July 19, 2016 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juliendufresne/92cfd86b0fc8a456ccbacee5fbb17e0b to your computer and use it in GitHub Desktop.
Save juliendufresne/92cfd86b0fc8a456ccbacee5fbb17e0b to your computer and use it in GitHub Desktop.
Install latest ansible from source in debian
#!/usr/bin/env bash
sudo apt-get install -y python-setuptools python-dev libffi-dev libssl-dev sshpass
sudo easy_install pip
sudo pip install paramiko PyYAML Jinja2 httplib2 six
cd $HOME;
git clone git://github.com/ansible/ansible.git --recursive
cd ./ansible
echo "source ./hacking/env-setup -q" >> ~/.bashrc
if which apt-get &>/dev/null # Debian / Ubuntu
then
sudo apt-get update
sudo apt-get install -y libssl-dev libffi-dev build-essential python-dev python-crypto ca-certificates
elif which yum &>/dev/null # RHEL
then
sudo yum install -y gcc libffi-devel python-devel openssl-devel
fi
wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
sudo easy_install urllib3 pyopenssl ndg-httpsclient pyasn1 pip
sudo pip install ansible
sudo pip install --upgrade Jinja2
if which apt-get &>/dev/null # Debian / Ubuntu
then
sudo apt-get install -y --reinstall python-crypto
elif which yum &>/dev/null # RHEL
then
sudo yum reinstall -y python-crypto
fi
echo "Python version: "$(python --version 2>&1 | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+")
echo "Ansible version: "$(ansible --version)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment