This is the original version of the Ansible install script. If you want the latest, please see the above link!
Install latest Ansible via pip + dependencies via a shell script
This file is used to install ansible in test kitchen when you set in the kitchen.yaml file
By default test kitchen will always download and use the latest version of this install file.
WARNING: AS SOON AS YOU MERGE CODE HERE IT IS INSTANTLY AVAILABLE TO EVERYONE DOING OMNIBUS KITCHEN ANSIBLE INSTALLS:
To get a previous version or lock the install script to a particular version update your kitchen.yaml file to: ansible_omnibus_url: https://raw.githubusercontent.com/neillturner/omnibus-ansible/ab2fa5771b6ef357786d7ff57d83fc8c97c22fed/ansible_install.sh
where ab2fa5771b6ef357786d7ff57d83fc8c97c22fed is the commit sha of the code.
centos-5.10- Fails due to
pipnot working on python 2.4.. this article provides a workaround, but it seemed risky and wouldn't reflect most user's reality of running Ansible on CentOS 5.
centos-6.4- Works! (Note: Has
centos-6.5- Works! (Note: Has
centos-7.0- Works! (Note: Has
ubuntu-10.04- Fails due to
It does some basic OS detection and tries to install all the things that Ansible needs, including some optional packages which are technically dependencies of some core Ansible modules (Ansible playbooks that use these modules would simply fail without them).
It also installs
ca-certificates and has built-in yum failure retry ability (With RHEL / CentOS, this is important because
yum tends to fail a lot due to stale cache and old SSL CA cert chain issues). It also tries to install via packaged
python-pip, and if that fails, it tries
This ends up being a lot of things to install (mainly due to optional Ansible module dependencies), but the hope is that it covers all the bases so that some Ansible modules don't just fail unexpectedly.
The tradeoff is the amount of download / install time this takes versus a more minimal install. This useful to avoid having to bootstrap Ansible's dependencies using a pre-role or
pre_tasks: in the test playbook when just testing one playbook or role without redoing the same work that already done in this script.
This script was built with reliability, resiliency, and installing all "full-stack" dependencies (hence: Omnibus) in mind, not speed.
Feel free to fork this repo and create custom install scripts.