Skip to main content
The AWX development environment workflow and toolchain uses Docker and docker-compose to provide dependencies, services, and databases necessary to run all of the components. It also bind-mounts the local source tree into the development container, making it possible to observe and test changes in real time.

Prerequisites

Docker

Prior to starting the development services, you’ll need docker and docker-compose. On Linux, you can generally find these in your distro’s packaging, but you may find that Docker themselves maintain a separate repo that tracks more closely to the latest releases. macOS and Windows: Linux platforms:

Docker Compose

If you’re not using Docker for Mac, or Docker for Windows, you may need, or choose to, install the docker-compose Python module separately:

Additional Tools

  • Ansible: Required for templating configuration files
  • OpenSSL: For generating SSL certificates

Building the Development Image

The AWX base container image contains basic OS dependencies and symbolic links into the development environment that make running the services easy.

Build the Image

The image will need to be rebuilt if there are any changes to Dockerfile.j2 or any of the files used by the templated Dockerfile.
Once the build completes, you will have an ansible/awx_devel image in your local image cache:
By default, this image will be tagged with your branch name. You can specify a custom tag by setting an environment variable:

Customizing the Receptor Image

By default, the development environment will use the devel image from receptor. The receptor binary is copied into the main awx_devel image. If you need to create a new receptor image:
Then use it with AWX:

Starting the Development Environment

Start the Containers

Run the AWX, PostgreSQL, and Redis containers:
This will automatically start all required services and dependent containers. Once the containers launch, your session will be attached to the AWX container, and you’ll be able to watch log messages and events in real time.
The make target assumes that the image you built is tagged with your current branch. You can choose a specific branch by setting COMPOSE_TAG:

Running in Detached Mode

To run docker-compose in detached mode:

Disable Color Output

Useful for CI environments:

Wait for Migrations

The first time you start the environment, database migrations need to run. Eventually you will see output like:

Initial Configuration

Create an Admin User

Before you can log into AWX, you need to create an admin user:
Remember the username and password, as you will use them to log into the web interface for the first time.

Load Demo Data (Optional)

You may also want to load some demo data. This will create a demo project, inventory, and job template:
This information will persist in the database running in the tools_postgres_1 container until the container is removed. You may periodically need to recreate this container if the database schema changes in an upstream commit.

Accessing AWX

You can now log into the AWX web interface at:

Advanced Configurations

Running a Cluster

Certain features or bugs are only applicable when running a cluster of AWX nodes. To bring up a 3 node cluster:
You can also mix control and execution nodes:
This creates:
  • 1 control node
  • 1 hop node (automatically created when execution nodes exist)
  • 2 execution nodes

Customized Mesh Node Cluster

For more complex topologies:
Topology:

Start with Minikube

To test container groups with Minikube:

Integration with External Services

Splunk Integration

Access Splunk at http://<server>:8000/ with credentials admin/splunk_admin.

HashiCorp Vault Integration

Prometheus and Grafana

Access Grafana at http://localhost:3001.

OpenTelemetry Integration

Development Workflow

Start a Shell

To run awx-manage commands inside the container:

Start AWX from Container Shell

For more control over the startup process:

Building the UI

Prerequisites on your local machine:
  • npm
  • nodejs
Build the UI:
Or use a local ansible-ui repository:
See the UI development documentation for more information.

Cleanup

Purge Containers and Images

Database Issues

If you encounter the infinitely-repeating Waiting for postgres to be ready message:

Troubleshooting

Configuration Files

  • Inventory file: tools/docker-compose/inventory - used to configure the AWX development environment
  • Migration playbook: tools/docker-compose/ansible/migrate.yml - for migrating data from Local Docker

Tested Operating Systems

The docker-compose development environment is regularly used and should work on x86_64 systems running:
  • Fedora (maintained versions)
  • Ubuntu LTS (18, 20)
  • Red Hat Enterprise Linux 8, CentOS Stream 8
  • macOS 11
Use on other platforms is untested and may require local changes.

Next Steps