This can be done in two simple steps:
Step 1: Set up EPEL Repository
EPEL (Extra Packages for Enterprise Linux) is an open source and free community-based repository project from Fedora team which provides high-quality add-on software packages for Linux distribution including RHEL (Red Hat Enterprise Linux), CentOS, and Scientific Linux.
The Ansible package is not available in the default yum repositories, so we will enable EPEL repository by using the below command:
sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
This will download all the necessary packages which will be required to install Ansible.
Step 2: Install Ansible
Now that your EPEL repository has been added, all you have to do now is install Ansible using the command below:
yum install ansible -y
That's all! It's a two-step process that barely takes a minute!
If you wish to check the version of Ansible installed on your system, use the command below:
ansible –version