Fast track: Installing Ansible 2.1 stable on Oracle Linux 6.7

Ansible can certainly be installed using prebuilt packages from the EPEL repository, but while convenient, their offering is limited to Ansible 1.9.x – that is to say only versions prior to the major 2.0 release that includes a number of significant improvements, that were seen further polished in 2.1.

You will, more than likely, want to run 2.1.2, the latest stable release, for any production use, or perhaps the penultimate 2.0.1 release, if you are of a slightly more conservative origin.

That being said, I’ve always been told that DBAs like myself are about as conservative as they come, and I surprisingly experience no additional anxiety doing mission critical work with Ansible 2.1.2, which in truth, appear to be a solid release of the project’s most mature code yet. I should say these feelings are in strong contrast to those that come attached with Enterprise Linux 7 and Oracle Database 12c, products which are still years away from prime time in my twisted paradigm of the world.

These few commands should take care of dependencies required to build an RPM, pull Ansible code from their official repository on GitHub and do a checkout of the 2.1 stable release before building an RPM package on and for your system – which you can then install locally on your machine or distribute in your environment as you see fit. On a side note, I like to maintain local/internal repositories with custom built packages and approved updates, which lets me stay in control while keeping yum in position to deal with the tedious bits.

I’m using Oracle Linux 6.7 and have not tested this elsewhere, but the commands and package names should be identical on any 6 or 7 release of Oracle Linux, CentOS or RHEL and you should consequently be able to install without any modifications other than variations to the name of the generated RPM file.

sudo yum -y install git python2-devel rpm-build asciidoc
cd /usr/src ; sudo git clone git://github.com/ansible/ansible.git -b stable-2.1 --recursive
cd ansible ; sudo make rpm

You should now be presented with the name of the ready to install RPM package, you do need to grab said name and customize the final yum command:

#############################################
Ansible RPM is built:
 rpm-build/ansible-2.1.2.0-100.git201608311757.e83840c.HEAD.el6.noarch.rpm
#############################################
[roy@kayna ansible]$ sudo yum -y install rpm-build/ansible-2.1.2.0-100.git201608311757.e83840c.HEAD.el6.noarch.rpm
Loaded plugins: fastestmirror, refresh-packagekit, rhnplugin, security, ulninfo
This system is receiving updates from ULN.
Setting up Install Process
....
....

In my case I had the Ansible 1.9.4-1 package from EPEL already installed on my system, yum smoothly replaced the existing RPM installation and upgraded to Ansible 2.1.2 without any fuzz.

[roy@kayna ansible]$ ansible --version
ansible 2.1.2.0
 config file = /etc/ansible/ansible.cfg
 configured module search path = Default w/o overrides
This entry was posted in Ansible, CentOS, Enterprise Linux, Oracle Linux, Red Hat Enterprise Linux, Technical and tagged , , , , . Bookmark the permalink.

2 Responses to Fast track: Installing Ansible 2.1 stable on Oracle Linux 6.7

  1. Amit says:

    sudo make rpm gives me below error:
    What should be done to resolve this?

    sed “s/%VERSION%/2.1.2.0/” docs/man/man1/ansible.1.asciidoc.in > docs/man/man1/ansible.1.asciidoc
    ERROR: AsciiDoc ‘a2x’ command is not installed but is required to build docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1 docs/man/man1/ansible-pull.1 docs/man/man1/ansible-doc.1 docs/man/man1/ansible-galaxy.1 docs/man/man1/ansible-vault.1
    make: *** [docs/man/man1/ansible.1] Error 1
    rm docs/man/man1/ansible.1.asciidoc

Leave a Reply

Your email address will not be published. Required fields are marked *