How to install Ansible AWX on CentOS 7

Share on Social Media

In this article, you will learn how to install Ansible AWX on CentOS 7 with docker-compose. #centlinux #ansible #docker

What is AWX Project? :

AWX Project or AWX is a web based console for Ansible. AWX is designed to make Ansible more usable for DevOps members of different technical proficiencies and skill sets. AWX is a hub for automation tasks. Ansible Tower is a commercial product supported by Red Hat, Inc. but derived from AWX upstream project, which is open source since September 2017. This makes AWX a good alternative of Ansible Tower.

Currently, stable version of AWX 7.0 has been released that requires a containerized environment to install and run. According to AWX Project Documentation, we can deploy AWX on following containerization platforms.

We are using Docker-Compose here, because it is relatively easy to setup and requires less hardware resources as compare to OpenShift and Kubernetes.

We have already install Ansible on CentOS 7. Now, we are installing AWX with Docker-Compose on the same Ansible control node.

If you want to improve your knowledge about Ansible, then you should refer to Ansible Documentation or get a copy of Ansible Quick Start Guide: Control and monitor infrastructures of any size, physical or virtual (PAID LINK) by Packt Publishing.

Besides that, you can enroll in Ansible: Ansible Automation Masterclass: 2-in-1 at Udemy to be a master of Ansible in no time.

Environment Specification:

We are using three CentOS 7 virtual machines with following specifications.

  • CPU – 3.4 Ghz (2 Cores)
  • Memory – 4 GB
  • Storage – 60 GB
  • Hostname –
  • IP Address – /24
  • Operating System – CentOS 7.6

Install EPEL Yum Repository:

Connect with by using ssh as root user.

AWX requires some packages that are available in EPEL (Extra Packages for Enterprise Linux) yum repository. Therefore, we are installing epel-release package by using yum command to enable EPEL.

# yum install -y epel-release

Install Ansible AWX Prerequisites:

AWX requires some prerequisite software packages, all of these packages are available in standard and EPEL yum repositories.

Therefore, we are Installing all prerequisite packages using a single yum command.

# yum -y install git gcc gcc-c++ nodejs gettext device-mapper-persistent-data lvm2 bzip2 python-pip

Install Docker CE on CentOS 7:

Install Docker CE yum repository from Docker official website.

# yum-config-manager --add-repo=
Loaded plugins: fastestmirror
adding repo from:
grabbing file to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo

Since the Docker CE yum repository has been added, we can now install Docker CE using yum command.

# yum install -y docker-ce

Enable and start Docker service.

# systemctl enable --now docker.service
Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/docker.service.

Install Docker-Compose on CentOS 7:

PyPI (Python Package Index) is a software package repository of software written  in Python. PyPA (Python Package Authority) recommend use of PyPI for installation of Python software packages.

Therefore, we are installing docker-compose using pip command.

# pip install docker-compose

Install Ansible AWX on CentOS 7:

Use git command to download AWX project from GitHub.

# git clone --depth 50
Cloning into 'awx'...
remote: Enumerating objects: 8850, done.
remote: Counting objects: 100% (8850/8850), done.
remote: Compressing objects: 100% (4428/4428), done.
remote: Total 8850 (delta 5006), reused 6388 (delta 4234), pack-reused 0
Receiving objects: 100% (8850/8850), 11.30 MiB | 246.00 KiB/s, done.
Resolving deltas: 100% (5006/5006), done.

Go to ~/awx/installer directory and set a custom admin_password for AWX and PostgreSQL in inventory file.

# cd awx/installer
# sed -i 's|admin_password=.*|admin_password=Ahmer@1234|g' inventory

Generate a random key to use for encryption in inventory file.

# openssl rand -base64 30

Add the generated string as secret_key in inventory file.

# sed -i 's|secret_key=.*|secret_key=ejv9P72oNvD4AtWLhOUTvpxfdIfKIid3skwuK+ES|g' inventory

You can also customize many directives here, according to your requirements.

Verify the changes that we have made in inventory.

# grep -v '^#' inventory | grep -v '^

Install AWX by using ansible-playbook command.

# ansible-playbook -i inventory install.yml

Ansible uses docker-compose to create the required containers by AWX. It will take time, according to your server’s specs, therefore sit back and relax for a while.

After successful configuration of AWX and relevant containers. You can check the list of Docker processes to the running containers that are created by docker-compose for AWX.

# docker ps
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                                                 NAMES
2c36037e1edf        ansible/awx_task:7.0.0       "/tini -- /bin/sh -câ¦"   2 minutes ago       Up 2 minutes        8052/tcp                                              awx_task
4af8c2a57530        ansible/awx_web:7.0.0        "/tini -- /bin/sh -câ¦"   2 minutes ago       Up 2 minutes>8052/tcp                                  awx_web
5580f44da60a        memcached:alpine             "docker-entrypoint.sâ¦"   2 minutes ago       Up 2 minutes        11211/tcp                                             awx_memcached
341e0660e369        ansible/awx_rabbitmq:3.7.4   "docker-entrypoint.sâ¦"   2 minutes ago       Up 2 minutes        4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 25672/tcp   awx_rabbitmq
6529a106ab89        postgres:10                  "docker-entrypoint.sâ¦"   2 minutes ago       Up 2 minutes        5432/tcp                                              awx_postgres

Allow HTTP service in Linux firewall, because the port 80 is mapped to the AWX container and it is used to access AWX web console.

# firewall-cmd --permanent --add-service=http
# firewall-cmd --reload

Open URL in a web browser.

Ansible AWX Login

Login as Admin User.

Ansible AWX Dashboard

We are reached at the dashboard of Ansible AWX.

Conclusion – Install Ansible AWX on CentOS 7:

In this article, you have learned how to install Ansible AWX on CentOS 7 with docker-compose.