How can install specific version of ansible?

34,756

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.

Share:
34,756

Related videos on Youtube

salauddin
Author by

salauddin

Updated on September 18, 2022

Comments

  • salauddin
    salauddin over 1 year

    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?

    • Admin
      Admin over 7 years
      Use the source, Luke!
    • Admin
      Admin over 7 years
      yum list|grep -i ansible did output ansible.noarch 2.1.2.0-1.el7 in epel repo
    • Admin
      Admin over 7 years
      yes "ansible.noarch 2.1.2.0-1.el6 epel"
    • Admin
      Admin over 7 years
      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.)
  • undersound
    undersound almost 7 years
    ansible=2.0.0.1 should be ansible==2.0.0.1
  • Snowcrash
    Snowcrash over 5 years
    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.
  • WangJie
    WangJie over 5 years
    @Snowcrash which version are you trying to install and which version are you getting instead?