Install Ansible AWX on CentOS 8

Linux Jun 20, 2020

Ansible AWX (Ansible Web eXecutable) is a free and open-source project that ultimately gives rise to Red Hat Ansible Tower. AWX provides a web-based user interface and task engine built on top of Ansible.

Preparing the server for Installation

These steps will prepare the CentOS 8 server and install Docker, enabling the AWX Docker container to run.

I am starting with a minimal install of CentOS 8.2. You will need the EPEL repository if it is not already installed on your system.

dnf install epel-release -y

You will need the following packages installed.

dnf install git gcc gcc-c++ ansible nodejs gettext device-mapper-persistent-data lvm2 bzip2 python3-pip -y

Add the Docker repository.

dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

Install the most recent version of Docker that is compatible with CentOS 8

dnf install docker-ce —-nobest 

Start Docker and enable it to run at boot

systemctl start docker
systemctl enable docker 

Install Docker Compose

pip3 install docker-compose
set python /usr/bin/python3

Create a directory for the Postgres database

mkdir /var/lib/pgdocker

Add firewall rules and reload the firewall to apply the new rules

firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https

firewall-cmd --reload

Installing AWX

Download the latest release of AWX from GitHub

git clone -b 12.0.0 https://github.com/ansible/awx.git

Change to the installer directory and open the inventory file in a text editor

cd awx/installer/
vi inventory

Change the following paths and set your DNS server

postgres_data_dir="/var/lib/pgdocker"
docker_compose_dir="/tmp/awxcompose"
project_data_dir="/var/lib/awx/projects"
awx_alternate_dns_servers=”8.8.8.8,8.8.4.4"

Change the default Postgres password and generate a random encryption key

pg_admin_password=KFWm6y3685
secret_key=GsLHXzBYKodn4lPWf6F7Z5T9ucemqCp08aiwrS3NQtRAkgIJDO1Uxyh2j

Save the changes and exit Vim

:wq

Run the Ansible installation Playbook to deploy the AWX Docker containers

ansible-playbook -i inventory install.yml
Ansible installation Playbook
Ansible installation Playbook

Once the playbook has completed, AWX will have been installed.

To access the AWX web console, open your browser and enter your Ansible AWX server IP

AWX is Upgrading screen
AWX is Upgrading screen

The first time you access the web console, you will get an updating screen. After a couple of minutes, it will refresh with the login screen.

AWX Login screen
AWX Login screen

Log in using the default account (admin/password), and then you will get the AWX Dashboard.

AWX Dashboard
AWX Dashboard

Tags