Data Center Handbook All things automation

Installing a Previous Ansible Release on Ubuntu

If you are installing the latest version of Ansible on Ubuntu you can utilize the Ansible ppa (Personal Package Archives) and apt-get to complete the install process without any hassle.

$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible

However, things get a bit tricker if you are trying to install a previous release. Traditionally, you could utilize sudo apt-get install package=version to install the required version but the Ansible ppa only houses the latest package available. Or does it?

Thanks to some filtering magic on the ppa you can pull up 103 previous versions of Ansible. From there you can use wget to download the version you are looking for and complete the installation with the following:

$ sudo dpkg -i previous_version.deb
$ sudo apt-get -f install

Once thats completed you will be up and running and can delete the downloaded .deb package.