AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. This tutorial will walk you through the steps to set up Ansible AWX using Docker on a CentOS/RHEL 7/8.
Find the following line and replace the value "enforcing" with "disabled":
Save and close the file.
Type below command if you are running CentOS/REHL 8:
Type below command if you are running CentOS/RHEL 7:
Next, install following additional dependencies on your CentOS/RHEL using the below command:
Type below on CentOS/RHEL 8:
Type below on CentOS/RHEL 7:
Type below to add Docker repository on CentOS/RHEL 8:
Type below command to install Docker on CentOS/RHEL 8:
Type below to create Docker repository on CentOS/RHEL 7:
Add following contents:
Save and close the file.
Type below to install Docker on CentOS/RHEL 7:
Next, start the Docker service and make it persistent on system reboot with below command:
Confirm that docker is active and running:
You will see similar output like below:
![]()
Type below to install Docker Compose on CentOS/RHEL 7/8:
Once you are finished with docker and docker compose installation, type the below command to set python 3 in environment variable:
When download complete, generate a secret key using openssl to encrypt inventory file:
You will see the output similar to the following:
Copy your key and save it for later use in the inventory file.
Replace the following values with yours:
Save and close the file when you are finished.
Next, create a pgdocker directory under /var/lib/
Type the following command to install AWX:
Upon successful installation, you will see output similar to the following:
This will create and start all the required Docker containers for Ansible AWX.
You can verify the running containers with the following command:
You will see output similar to the following:
IMAGE HERE
Log in with the admin username and password which you have defined in the inventory file, you should see the AWX default dashboard like below:
IMAGE HERE
Prerequisites
To follow this guide along, you will need one (physical or virtual) machine with CentOS/RHEL 7/8 minimal installed having a non-root user sudo privileges.Configure SELinux
By default, SELinux is enforcing in CentOS/RHEL 7/8. It is recommended to change SELINUX=enforcing to SELINUX=disabled to run Ansible AWX under a Docker container:Find the following line and replace the value "enforcing" with "disabled":
Save and close the file.
Install EPEL Repository
You will need to install the extra packages for enterprise Linux (EPEL) repository on your CentOS/RHEL 7/8:Type below command if you are running CentOS/REHL 8:
Type below command if you are running CentOS/RHEL 7:
Next, install following additional dependencies on your CentOS/RHEL using the below command:
Type below on CentOS/RHEL 8:
Type below on CentOS/RHEL 7:
Install Docker
In this section, we will install Docker and Docker Compose to run Ansible AWX inside a Docker container:Type below to add Docker repository on CentOS/RHEL 8:
Type below command to install Docker on CentOS/RHEL 8:
Type below to create Docker repository on CentOS/RHEL 7:
Add following contents:
Save and close the file.
Type below to install Docker on CentOS/RHEL 7:
Next, start the Docker service and make it persistent on system reboot with below command:
Confirm that docker is active and running:
You will see similar output like below:
![](http://1.bp.blogspot.com/-ULMHUBX-SE8/XnzK09k2xMI/AAAAAAAASok/40xe5xQxyjEekEbnrsdrLewsDGIaf99nQCLcBGAsYHQ/s1600/docker_service_status.png)
Type below to install Docker Compose on CentOS/RHEL 7/8:
Once you are finished with docker and docker compose installation, type the below command to set python 3 in environment variable:
Download Ansible AWX
You can download Ansible AWX latest release from the Git Hub repository using the below command:When download complete, generate a secret key using openssl to encrypt inventory file:
You will see the output similar to the following:
Copy your key and save it for later use in the inventory file.
Install Ansible AWX
You need to edit inventory file like below:Replace the following values with yours:
Save and close the file when you are finished.
Next, create a pgdocker directory under /var/lib/
Type the following command to install AWX:
Upon successful installation, you will see output similar to the following:
This will create and start all the required Docker containers for Ansible AWX.
You can verify the running containers with the following command:
You will see output similar to the following:
Add Firewall Rules
You will need to add following rules to allow http and https service to pass through firewalld:Access AWX Web Interface
Open up your preferred web browser and type the http://your-server-ip in the address bar, you will be redirected to the AWX login page like below:IMAGE HERE
Log in with the admin username and password which you have defined in the inventory file, you should see the AWX default dashboard like below:
IMAGE HERE