Last active
July 19, 2016 02:16
-
-
Save juliendufresne/92cfd86b0fc8a456ccbacee5fbb17e0b to your computer and use it in GitHub Desktop.
Install latest ansible from source in debian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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