13

How can I install a specific version of Ansible, using Yum or another method?

When I try to install version 2.0 it says No package 2.0 available.

I checked the epel repo. There are only two rpms, but no rpm containing version 2.0. Why are they removed? Is there any way to install a specific version of ansible, like 2.0?

peterh
  • 9,488
  • 16
  • 59
  • 88
salauddin
  • 325
  • 2
  • 3
  • 6
  • 2
    Use the source, Luke! – Ipor Sircer Nov 08 '16 at 11:29
  • yum list|grep -i ansible did output ansible.noarch 2.1.2.0-1.el7 in epel repo – Nawaz Sohail Nov 08 '16 at 11:29
  • yes "ansible.noarch 2.1.2.0-1.el6 epel" – salauddin Nov 08 '16 at 11:37
  • 1
    I recall a co-worker recently handled an Ansible upgrade—you should know that it's only recently that Ansible became available via RPM. Prior to that it was only available as a tarball. I *believe* that was version 2.0 that we were upgrading from. In other words, I don't think there ever was an RPM for Ansible 2.0. (I haven't researched the matter myself, though.) – Wildcard Nov 08 '16 at 12:11

1 Answers1

18

I would recommend pip:

sudo pip install 'ansible==2.0.0.1' 

More information on ansible[1] and pip[2] documentation.

And if you want to have more than one installed version, just use create virtualenv:

virtualenv .env
source .env/bin/activate
pip install 'ansible==2.2.0.0'

and only this terminal will use this specific version of Ansible. Then repeat the process for each combination you want.

Willian Paixao
  • 2,691
  • 3
  • 18
  • 33