How Do You Install Ansible on an AWS Instance of RedHat Enterprise Linux?

Problem scenario
One of the following applies:
1. You want to install Ansible on an AWS instance of RHEL.  
2. You want to install Ansible on a GCP server running RHEL.

How do you do either of these things?

Solution
These directions should work for other RedHat distributions of Linux (e.g., Fedora or CentOS) that are not AWS servers as long as the server has 2 GB of RAM.

Prerequisite:  Create an RHEL 7.x instance with 2 GB of RAM.  If you cannot afford this much memory, you could use virtual memory (aka swap space) by following the directions on this link.

Run these commands:  

sudo yum -y update
sudo yum -y install gcc python-devel openssl-devel  
sudo curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
sudo python get-pip.py
sudo pip install ansible

# Test your installation with this command:  ansible --version
# If the above does not work, you may have packages configured in a special way. You may want to try this command: sudo yum -y install ansible

Leave a comment

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