Multiple ansible versions on same laptop

igormukhingmailcom picture igormukhingmailcom · Apr 9, 2015 · Viewed 8.8k times · Source

Can anyone tell how to install two or more ansible versions on one Ubuntu laptop?

When I publish my roles in galaxy.ansible.com, I want to set minimal requirement version in meta/main.yml. But now I have ansible 1.9 on my machine, so have dilemma:

  • Write 1.9 to meta/main.yml
  • Write to meta/main.yml lower version with fingers crossed

I've found next comment at ansible docs:

Debian/Ubuntu packages can also be built from the source checkout, run:
$ make deb

So I can compile 1.4, 1.5 for example for testing purposes. But I want to able to fast select which version to use - 1.4 and 1.5 for testing and 1.8 for normal daily usage.

Also, I've not found how to specify ansible version in Vagrantfile, so I must have ansible with proper version on my machine?

Thank you.

Answer

igormukhingmailcom picture igormukhingmailcom · Apr 9, 2015

I've found solution at http://www.cyberciti.biz/python-tutorials/linux-tutorial-install-ansible-configuration-management-and-it-automation-tool/.

With some modifications that is fully work example:

cd /tmp
git clone -b v1.4.0 --recursive https://github.com/ansible/ansible.git v1.4.0
source ./v1.4.0/hacking/env-setup
ansible --version # will print ansible 1.4