Site icon GetPageSpeed

Install latest stable Ansible on CentOS/RHEL 8

Ansible

Ansible

While RHEL 8 is being quite fresh, there are no packages available for many things.

But how do you get up to rock and roll latest stable Ansible on RHEL 8 based system, running as control node?

CentOS 8

sudo yum install python3
sudo alternatives --set python /usr/bin/python3
python --version
sudo yum install python3-virtualenv

In your Ansible-powered project, create virtualenv:

virtualenv venv
. venv/bin/activate
pip install ansible

Now Ansible is safely installed to venv of your project. Whenever you need to run it, make sure to activate the virtual environment first, e.g.:

virtualenv venv
ansible --version

RHEL 8

If you’re using the actual RHEL 8, things are easier:

sudo subscription-manager repos --enable ansible-2.8-for-rhel-8-x86_64-rpms
sudo dnf install ansible

or, for latest 2.9:

sudo subscription-manager repos --enable ansible-2.9-for-rhel-8-x86_64-rpms
sudo dnf install ansible
Exit mobile version