Work

Install latest stable Ansible on CentOS / RHEL 8

by , , revisited on


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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.