Installing Ansible 2.10.x on CentOS/RHEL 7

This is the cleanest method I’ve found to install Ansible > 2.9 on CentOS/RHEL 7.

Due to Python 3.6 being the highest Python version available and that there are no official RPMs of Ansible available for EL7, there isn’t an alternative I have found to installing Ansible at a system level via root. This is the cleanest way I have found to accomplish this without polluting the system Python tree, hopefully avoiding issues patching the system in the future due to Python library collisions.

This has been tested using the latest Morpheus 5.5.0. The reason for symlinking the ansible scripts is for compatibility with default Morpheus pathing for the morpheus-local user.

yum install -y epel-release python3
yum install -y python36-cryptography
LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 pip3 install ansible==2.10.7
ln -s /usr/local/bin/ansible* /usr/local/sbin/