How to run the latest AWX in Docker containers?

Running AWX in local Docker containers allows you to test the AWX web-UI and API to easily manage Ansible Playbook execution. AWX run on Docker is considered for Testing or Development only, the preferred way is via the AWX Operator since version 18.0. This initial configuration sometimes is a roadblock for some Ansible AWX users. I'm Luca Berton and welcome to today's episode of Ansible Pilot.

Ansible AWX

  • Ansible AWX is the upstream project of Ansible Automation Controller (fromelly Ansible Tower)

AWX is a very modern web UI and API that allows you to manage Ansible Playbooks, Inventories, Credentials, and Vaults between your team in your organization. Running AWX is a convenient way to centralize the storing and execution of all your Ansible resources and grant the relevant permissions only to selected users across your organization. Ansible AWX is the upstream project of Ansible Automation Controller (formerly Ansible Tower). The Ansible Automation Controller is part of the Red Hat Ansible Automation Platform (AAP). Red Hat released the AWX project under the Apache 2.0 Open Source license. Under the hood, it relies on cutting-edge Open Source technologies such as Redis, PostgreSQL, Django, and Python.

Links

  • [ansible/AWX GitHub repository](https://github.com/ansible/awx)

Playbook

How to run AWX in a Docker container. I'm going to show you how to get started on the latest AWX stable version (21.5.0 at the moment). I tested the following procedure on a Fedora 36 workstation. A step-by-step guide on how to build and run the latest Ansible AWX Base Container Image and Ansible Receptor Image and run the UI, crfeate an admin example user.

Prerequisites

Ansible AWX support only x86_64 operating system:

  • Fedora (maintained versions)
  • Ubuntu LTS (20.04 or 22.04)
  • Red Hat Enterprise Linux 8+, CentOS Stream 8+
  • macOS 11

The additional software must be installed:

  • OpenSSL library
  • [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
  • [Docker](https://docs.docker.com/engine/installation/)

Please note that the latest Docker technology should be installed in the target system, the Docker service must be started and the current user added in the docker group.

  • [docker-compose](https://pypi.org/project/docker-compose/) Python module
  • [Docker Compose](https://docs.docker.com/compose/install/)

Build Ansible AWX

How to build the Ansible AWX Base Container Image and download the latest Ansible Receptor Image.

1. Clone the latest stable tag Ansible AWX repository

git clone -b x.y.z https://github.com/ansible/awx.git

Substitute x.y.z with the [latest release version number](https://github.com/ansible/awx/releases/latest) (for example 21.5.0).

2. Configure the inventory (optional)

You can customize the inventory parameters pg_password, broadcast_websocket_secret, secret_key, and any other settings you n