Install Ansible AWX on CentOS 8
Ansible AWX (Ansible Web eXecutable) is a free and open-source project from which Red Hat Ansible Tower is ultimately derived. AWX provides a web-based user interface and task engine built on top of Ansible.
Preparing server for Installation
These steps will prepare the CentOS 8 server and install Docker to be able to run the AWX Docker container.
I am starting with a minimal install of CentOS 8.2. You will need the EPEL repository if you don’t already have it 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
Create a directory for the Postgres database
mkdir /var/lib/pgdocker
alternatives — set python /usr/bin/python3
Add firewall rules and reload firewall to apply 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 install Ansible Playbook to deploy the AWX docker containers
ansible-playbook -i inventory install.yml
Once the playbook has completed, AWX will have been installed.
To access AWX web console, open your browser and enter your Ansible’s AWX server IP
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.
Login using the default account (admin/password), and then you will get the AWX Dashboard.