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:
meta/main.yml
meta/main.yml
lower version with fingers crossedI'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.
You can sudo pip install ansible==1.8. 4 in one python virtualenv and pip install another version ansible==1.9. 0.1 in different virtual environment. Multiple virtualenvs can be based on the same python version as well.
Selecting an Ansible version to install Install the latest release with your OS package manager (for Red Hat Enterprise Linux (TM), CentOS, Fedora, Debian, or Ubuntu). Install with pip (the Python package manager). Install from source to access the development ( devel ) version to develop or test the latest features.
Currently Ansible can be run from any machine with Python 2 (version 2.7) or Python 3 (versions 3.5 and higher) installed. Windows isn't supported for the control machine.
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
You can sudo pip install ansible==1.8.4
in one python virtualenv and pip install another version ansible==1.9.0.1
in different virtual environment. Multiple virtualenvs can be based on the same python version as well.
Another completely different solution is to install ansible within a docker container. Here is nice centos image with ansible already installed in it. There are also ubuntu and debian images.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With