12

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?

4
  • 2
    Use the source, Luke! Nov 8 '16 at 11:29
  • yum list|grep -i ansible did output ansible.noarch 2.1.2.0-1.el7 in epel repo Nov 8 '16 at 11:29
  • yes "ansible.noarch 2.1.2.0-1.el6 epel"
    – salauddin
    Nov 8 '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 8 '16 at 12:11
14

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.

3
  • 3
    ansible=2.0.0.1 should be ansible==2.0.0.1
    – undersound
    Jun 13 '17 at 9:03
  • This doesn't work. After running those 3 steps I ran ansible --version in the exact same terminal and environment and it was still running my old version.
    – Snowcrash
    Oct 16 '18 at 15:43
  • @Snowcrash which version are you trying to install and which version are you getting instead? Oct 26 '18 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.