Linux, Utility

How To: Install Ansible on Red Hat Enterprise Linux 7 (RHEL 7)

For some time now you have been able to download and use for personal development Red Hat Enterprise Linux 7 as part of the “No-cost RHEL Developer Subscription” programme.

There are plenty of tutorials out there on how to install Ansible on RHEL and other Linux variations so this guide serves as the process I went through to install & configure Ansible on a freshly deployed RHEL 7 instance.

Step 0 – Prepping RHEL 7

If you have just downloaded the RHEL 7 ISO as part of the developer subscription model we will need to perform some initial tasks to get it up to scratch

  1. Authenticate your subscription
    subscription-manager register –username your_username –password your_password
  2. Update the OS
    yum update && yum upgrade
  3. Let’s install some classics such as ifconfig & wget
    yum install net-tools
    yum install wget
  4. We also need access to the “Extra Packages for Enterprise Linux” for downloading packages outside the normal channels
    rpm -ivh epel-release-latest-7.noarch.rpm
    yum install epel-release

So at this point we should have a RHEL 7 instance ready to go.

Step 1 – Installing Python, Python Tooling & Ansible

  1. We’ll install Python first
    sudo yum install python
  2. Next we’ll install PIP which is a “package management system used to install and manage software packages written in Python”
    sudo yum install python-pip
  3. Now we need to upgrade it
    sudo pip install –upgrade pip
  4. Next we’ll use PIP to install some liraries and modules for python & Ansible
    sudo pip install markupsafe
    sudo pip install xmltodict
    sudo pip install pywinrm
  5. And finally we will install Ansible
    sudo yum install ansible
  6. To confirm that it has been installed correctly we’ll execute
    ansible –version
    Which should generate the following output

    [asecor@labansc]$ ansible --version
      config file = /etc/ansible/ansible.cfg
      configured module search path = Default w/o overrides

    Done! We now have a working Ansible installation on Red Hat Linux 7!


13 Comments to “How To: Install Ansible on Red Hat Enterprise Linux 7 (RHEL 7)”

  1. boanerges john

    i followed above steps but it was not installed

    the result was

    Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
    No package ansible available.
    Error: Nothing to do


Leave a Comment

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