How to Install Ansible AWX using Docker Compose (Build Ansible AWX Container) 20.04. In this guide we will introduce Ansible AWX with it’s main advantages then move onto installation with Docker Compose.
AWX is a Ansible Tower based tool that offers a web interface and a task engine that helps users to manage their Ansible project form the central place.
Let’s start with how to Install Ansible AWX using Docker Compose (Build Ansible AWX Container) 20.04.
AWX is an open source project behind Red Head Ansible Tower. It is designed to offer developers access to the latest features and the opportunity to directly collaborate with the Ansible Tower Engineering team. It is a code development branch that undergoes minimal and quality engineering testing.
Enterprise adoption has some drawbacks that include a lack of signed images for using it in the enterprise, support being offered. Also it is complex or lack of actual versioning being present with upgrades. However, Ansible AWX is a powerful open source, freely available project that enables organizations to test and use Ansible AWX in a lab, development, or other POC environment.
The greatest benefit it provides its users is that they can use all the enterprise features for an unlimited number of nodes.
With the AWX it also has some of the following interesting facts and features that prove to be beneficial while dealing with the day to day software management problems:
Dashboard – The dashboard of AWX provides a display for that is going on in the Ansible environment. It includes: 1. The number of successful and failed playbook job status. 2. Number of projects and the sync status. 3. Number of inventories. 4. Graph of the playbook currently running in the Ansible environment.
Support Multiple Clouds – You can integrate AWX with several clouds, including AWX & Azure, CGP, and many more.
Organized – It enables you to divide the users into teams and groups.
Centralized Logs – AWX can be integrated with multiple logging tools, like ELK & Loggly.
Role Based Access Control & Authentication – With the help of AWX, you can set up roles for our teams according to the least privilege policies. It can also be integrated with LDAP and Active Directory (AD) servers.
Increased Efficiency And Security– AWS provides you with better operational control and security. This way, it tends to increase the security of your team as well.
Job Scheduling – It helps you in scheduling planned jobs.
Scalability – Ansible AWX allows you to add or control nodes in the AWS cluster based on your requirements.
User Activity Tracking – With the help of Ansible AWS, you can also track the activities of the users, like who runs the job, what type of job they run, when they run the job, and a lot more.
Follow this post to show you how to install Ansible AWX using Docker Compose on Ubuntu 20.04.
Install Ansible AWX using Docker Compose on Ubuntu 20.04
Secondly you will need to install the Docker and Docker Compose package on your server. By default, the latest version of Docker is not available on Ubuntu default repository. So you will need to add the Docker CE repository to APT.
First of all install required dependencies using the following command:
You can also verify the Docker Compose version using the following command:
docker-compose --version
You should see the following output:
docker-compose version 1.25.0, build unknown
Next, you will need to install the Docker Compose Python module that matches the Docker Compose version. You can install it using the following command:
You can use the Docker Compose command line to verify all AWX containers. First, change the directory to the awxcompose with the following command:
cd ~/.awx/awxcompose
Verify all running container using the following command:
docker-compose ps
You should see the following output:
Name Command State Ports
--------------------------------------------------------------------------------------------
awx_postgres docker-entrypoint.sh postgres Up 5432/tcp
awx_redis docker-entrypoint.sh /usr/ ... Up 6379/tcp
awx_task /usr/bin/tini -- /usr/bin/ ... Up 8052/tcp
awx_web /usr/bin/tini -- /bin/sh - ... Up 0.0.0.0:80->8052/tcp,:::80->8052/tcp
To get a list of all Docker images, run the following command:
docker images
You should see the following list:
REPOSITORY TAG IMAGE ID CREATED SIZE
redis latest 3edbb69f9a49 4 days ago 117MB
postgres 12 ffc079081fed 10 days ago 373MB
centos 8 5d0da3dc9764 10 months ago 231MB
ansible/awx 17.1.0 599918776cf2 16 months ago 1.41GB
To check the AWX logs, run the following command:
docker-compose logs
You will get the following output:
awx_postgres | 2022-07-23 03:40:01.616 UTC [94] STATEMENT: SELECT "conf_setting"."id", "conf_setting"."created", "conf_setting"."modified", "conf_setting"."key", "conf_setting"."value", "conf_setting"."user_id" FROM "conf_setting" WHERE ("conf_setting"."key" = 'OAUTH2_PROVIDER' AND "conf_setting"."user_id" IS NULL) ORDER BY "conf_setting"."id" ASC LIMIT 1
awx_postgres | 2022-07-23 03:40:01.617 UTC [94] ERROR: relation "conf_setting" does not exist at character 158
awx_postgres | 2022-07-23 03:40:01.617 UTC [94] STATEMENT: SELECT "conf_setting"."id", "conf_setting"."created", "conf_setting"."modified", "conf_setting"."key", "conf_setting"."value", "conf_setting"."user_id" FROM "conf_setting" WHERE ("conf_setting"."key" = 'OAUTH2_PROVIDER' AND "conf_setting"."user_id" IS NULL) ORDER BY "conf_setting"."id" ASC LIMIT 1
awx_postgres | 2022-07-23 03:41:52.654 UTC [1] LOG: received fast shutdown request
awx_postgres | 2022-07-23 03:41:52.656 UTC [1] LOG: aborting any active transactions
awx_postgres | 2022-07-23 03:41:52.658 UTC [89] FATAL: terminating connection due to administrator command
awx_postgres | 2022-07-23 03:41:52.673 UTC [1] LOG: background worker "logical replication launcher" (PID 83) exited with exit code 1
awx_postgres | 2022-07-23 03:41:52.680 UTC [108] FATAL: terminating connection due to administrator command
awx_postgres | 2022-07-23 03:41:52.683 UTC [78] LOG: shutting down
awx_postgres | 2022-07-23 03:41:52.800 UTC [1] LOG: database system is shut down
awx_postgres |
awx_postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization
awx_postgres |
awx_postgres | 2022-07-23 03:41:54.783 UTC [1] LOG: starting PostgreSQL 12.11 (Debian 12.11-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
awx_postgres | 2022-07-23 03:41:54.784 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
awx_postgres | 2022-07-23 03:41:54.784 UTC [1] LOG: listening on IPv6 address "::", port 5432
awx_postgres | 2022-07-23 03:41:54.787 UTC [1] LOG: listening on Unix socket "https://net.cloudinfrastructureservices.co.uk/var/run/postgresql/.s.PGSQL.5432"
awx_postgres | 2022-07-23 03:41:54.820 UTC [26] LOG: database system was shut down at 2022-07-23 03:41:52 UTC
awx_postgres | 2022-07-23 03:41:54.927 UTC [1] LOG: database system is ready to accept connections
If you want to stop all running containers, run the following command:
docker-compose down
You can start all of them again with the following command:
docker-compose up -d
That’s great! Thank you for reading our article about How to Install Ansible AWX using Docker Compose (Build Ansible AWX Container) 20.04.
How to Install Ansible AWX using Docker Compose 20.04 Conclusion
In this post, we explained how to install Ansible AWX container using Docker Compose on Ubuntu 20.04. You can now easily manage all your Ansible projects from the AWX web based interface. AWS can be integrated with slack and email as well. By doing so, you tend to acquire notifications concerning the job status updates immediately after adding the call back plugin.
Read more about Ansible in our blog category here.
I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.
41vote
Article Rating
Subscribe
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.