Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How could i switch between Ansible versions?

Could i install several Ansible versions at a single OS and switch them at will? For now we have several releases, say 1.5.4 for Ubuntu, but the latest is 2.0.1, and 1.9.4 is still around. I would appreciate install all of them and just switch to one that is suitable for me. If yes, how?

like image 547
WebComer Avatar asked Apr 06 '16 14:04

WebComer


1 Answers

Ansible is just a python package, so, if you have virtualenv installed on your host it is just a matter of creating a new venv for each ansible version you want, and then pip install it.

So if for example you want ansible v1.9.5 you could do:

$ virtualenv ~/venvs/ansible_1_9_5
$ source ~/venvs/ansible_1_9_5/bin/activate
$ pip install "ansible==1.9.5" 
$ ansible --version
      ansible 1.9.5
      configured module search path = None
like image 63
shaps Avatar answered Oct 07 '22 06:10

shaps