Install Ansible 2.1 on RHEL/CentOS 7 with PIP

In order to install Ansible using PIP on RHEL 7 / CentOS 7 we will configure the EPEL 7 repository, and install all of the pre-requisite packages to get Ansible up and running.

Enable the EPEL repository

$ sudo yum-config-manager --add-repo=https://dl.fedoraproject.org/pub/epel/7/x86_64/

Download the EPEL GPG key

$ sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7

Install the GPG key

$ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Clean the local yum repository data

$ sudo yum clean all

Install the required packages

$ sudo yum install -y python-devel libffi-devel openssl-devel gcc python-pip redhat-rpm-config

 

Update to the latest version of pip

$ sudo pip install --upgrade pip

Install paramiko

$ sudo pip install paramiko

Install Ansible

$ sudo pip install ansible

Check the version

$ ansible --version
ansible 2.1.0.0
 config file =
 configured module search path = Default w/o overrides

And we are good to go!

Install Ansible 2.1 on RHEL/CentOS 7 with PIP