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
- Authenticate your subscription
subscription-manager register --username your_username --password your_password
- Update the OS
yum update && yum upgrade
- Let’s install some classics such as ifconfig & wget
Shell12yum install net-toolsyum install wget
- We also need access to the “Extra Packages for Enterprise Linux” for downloading packages outside the normal channels
Shell123wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm -ivh epel-release-latest-7.noarch.rpmyum install epel-release
So at this point we should have a RHEL 7 instance ready to go.
Step 1 – Installing Python, Python Tooling & Ansible
- We’ll install Python first
sudo yum install python
- 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
- Now we need to upgrade it
sudo pip install --upgrade pip
- Next we’ll use PIP to install some liraries and modules for python & Ansible
Shell123sudo pip install markupsafesudo pip install xmltodictsudo pip install pywinrm
- And finally we will install Ansible
sudo yum install ansible
- To confirm that it has been installed correctly we’ll execute
Which should generate the following output
Shell1234[asecor@labansc]$ ansible --versionansible 18.104.22.168config file = /etc/ansible/ansible.cfgconfigured module search path = Default w/o overrides
Done! We now have a working Ansible installation on Red Hat Linux 7!