[AWX] How to install AWX 11.2.0 by Python3 and Docker-Compose

  • OS Version: RHEL 7.8
  • Ansible Version: 2.9.9 (both yum and pip version)
  • Docker CE Version: 19.03.9
  • Docker-Compose Version: 1.25.5
  • Python2 Version: 2.7.5
  • Python3 Version: 3.6.8
  • Libselinux-python3 Version: 2.5-15
  • PostgreSQL Container Version: 10
  • PostgreSQL Version: 11.5-1PGDG
  • AWX Container Version: 11.2.0
  • Redis Contanier Version: 6.0.3
  • Memcached Container Version: 1.6.6



Please note that AWX is a new application for last few years, so the version change very quickly and this will let people need to be carefully on version selection when you want to install it.


My simulation environment:

Fresh install OS on RHEL 7.5 and upgrade to 7.8, so there will have python2 install on it. This will make your AWX installation more tricky, therefore it’s better to create a virtualenv for python3 or fresh install your OS by RHEL 8.

Based on this experience, RHEL 7.7 won’t be successful to install AWX because of the
“`libselinux-python“` version. On RHEL 7.7 the repo of yum only have python2 version **( I use python3 to install AWX )** and this bug is been solve on **RHEL 7.8** or later version.

According to Redhat official document: RHEA-2020:1165 – Product Enhancement Advisory

If you use python2 to intall AWX then this problem would not bother you.

“`install.yml“` file there are some module name “`docker_compose“`, if your ansible is early than 2.8 then you have to change the module name to “`docker_service“`, otherise the install playbook won’t work.

Redis vs RabbitMQ

After version 10.0.0 AWX replace RabbitMQ to Redis, so to prevent some Redis warning, we can modify some config.

If THP can not disable by above method then you will have to modify
“`grub“` config file. Please be noticed changing any config in grub file by wrong method will cause system crashed, so please modify it carefully.

Official System Packages (YUM) vs Python Install Packages (PIP)

There are some packages will conflict for each other or confuse user’s usages, so when you want to install AWX you will need to deal with this selection and make your own choice, because everyone’s architecture are different.

  • Yum: ansible, libselinux-python, pyOpenSSL (in python2?)
  • Pip: ansible, selinux, pyOpenSSL

You probably will get some error during your installation, please check the version of the above software package you are using. VirtualEnv will be a better way to avoid the packages problem, but still this is depends on your situation.

Simulation 1 – All in one

Fresh install AWX 11.2.0 without modify any config even password.

Try to simple the install process so would not have any external services.


Package list:

Pip: ansible, selinux, pyOpenSSL

System Packages

Pip Ansible

You can make python3 pip install ansible for your major version, but you will have to remove the system’s ansible.

But this is very annoying, so Python Virtualenv will be more easy way to do it.

Virtualenv Method

Install AWX

Generate Secret Key (If you need)

Git Source Code

You should find out the website goes up.

Bug resolve

Web GUI keep showing upgrading (migrations_notran).

This method works for me.

Simulation 2 – Using External PostgreSQL DB

  • PostgreSQL Version: 11.5-1PGDG

Fresh install AWX 11.2.0 and change PostgreSQL to external node, using external nginx to proxy AWX web and other config.


Package list:

Yum: ansible, libselinux-python3

Pip: pyOpenSSL

DB Instance Pacages

Change DB Config

Container Instance Packages

Create Virtualenv

Install AWX

Config file:

Install Bug Resolving

Using Extend Nginx to proxy

We can use docker volume to mount nginx conf folder to local VM, but if you don’t want to do that way. You can use local VM’s nginx to proxy your request.

So When your are install AWX, you have to change the host_port to other port number.

Then create your SSL key to apply for SSL Certification License.

Apply your SSL certificate and put the CRT file to the place you want.

Then install nginx.

Config file.

Nginx Web can not show anything

If you don see anything come from nginx and when you check the docker log see this log blew:

This error message shows that your nginx can not find out the external PostgreSQL DB, so I reinstall awx and change pg_hostname to different combination such as change to IP, FQDN(not shortname), edit
“`/etc/hosts“` file, using awx_alternate_dns_servers but still get the same error message.

I even find article that shows you have to change the docker file because of the
“`base.py“`, but I try not to modify official file.

Then I try to login to awx_web to investigate why hostname can not used. I discover that my old AWX have gateway, but my new AWX do not have.

Finally, I find a way to solve this problem.

After above command my docker gateway shows up……….weired.

LDAP Config

Then save your config and use your AD account to login then change your account to system administrator.

That’s all.


Selinux, Python, virtualenv, chroot and ansible don’t play nice.

Pipenv & Virtual Environments

A server error has occurred (/migrations_notran)

migrations_notran does not redirect if AWX is fully up

Why can’t I find ansible when I install it using setup.py?

AWX 11.0.0 Logstash connection refused

How to Install Ansible AWX with Nginx Reverse Proxy on Ubuntu 18.04 LTS

Error on Playbook syntax

AWX fails to start with docker-compose after upgrade to 10.0.0

AWX A server error has occured

set package version in Ansible

Ansible: How to change Python Version

Known issue with virtualenv and ansible on SELinux-enabled hosts

libselinux-python with virtualenvs require manual copy

Could not translate host name “db” to address using Postgres, Docker Compose and Psycopg2

“relation “conf_setting” does not exist at character 158″ & “relation “django_migrations” does not exist at character 124″ errors in postgres container


Ansible open sources Ansible Tower with AWX

How To Install Ansible AWX on CentOS RHEL 7/8

How to install Ansible AWX on centos 7

PostgreSQL 更改使用者帳號的密碼教學

UnixHTTPConnectionPool(host=’localhost’, port=None): Read timed out. (read timeout=60)

docker-compose up times out with UnixHTTPConnectionPool

Could not translate host name “db” to address using Postgres, Docker Compose and Psycopg2

Missing Gateway field in bridge network inspect

A server error has occurred when opening UI after fresh installdisable transparent hugepages)

CentOS / RHEL 7 : How to disable Transparent Huge pages (THP)

Lab: Ansible, Python3, and Virtualenvs on CentOS and RHEL

Can’t run Docker container due device mapper error

How to properly handle conflicting distutils libraries with pip?

Add a Comment