Ansible AWX is a free and open source Ansible Management tool created to provide System Administrators and Developers with an easy to use, intuitive and powerful web-based user interface for managing Ansible playbooks, Secrets, inventories, and Automation cron jobs scheduled to run at certain intervals. This guide explains how to install Ansible AWX on Debian 10 (Buster) Linux system.

Step 1: Install Ansible on Debian

Update your APT index.

sudo apt update

Add Ansible APT repository.

echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" | sudo tee /etc/apt/sources.list.d/ansible.list
sudo apt -y install gnupg2
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367

Install the latest release of Ansible using the commands below.

sudo apt update
sudo apt install -y ansible

Confirm installation by checking the version available.

$ ansible --version
ansible 2.8.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/debian/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.16 (default, Apr  6 2019, 01:42:57) [GCC 8.3.0]

Step 2: Install Docker and Docker Compose

All Ansible AWX services run in Docker containers. For this to happen, you need to install Docker engine.

Install Docker on Debian 10

Confirm Docker version installation with the following command.

~$ docker info
Client:
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.4
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.19.0-5-cloud-amd64
 Operating System: Debian GNU/Linux 10 (buster)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.857GiB
 Name: deb10
 ID: PYX7:PPC7:DWI3:O4QD:H524:5HCS:VYJK:T7Y2:GP32:J6OF:AOWZ:XQKW
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Install Docker Compose:

How To Install Latest Docker Compose on Linux

Docker Compose details.

$ docker-compose version
docker-compose version 1.24.1, build 4667896b
docker-py version: 3.7.3
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.1.0j  20 Nov 2018

Step 3: Install Node.js and NPM on Debian

Install Node.js and NPM packages using apt command.

sudo apt install -y nodejs npm
sudo npm install npm --global

Step 4: Install Ansible AWX on Debian 10 (Buster)

Before we install Ansible AWX on Debian 10 (Buster), install few required Ansible packages and modules.

sudo apt -y install python3-pip git pwgen vim  python3-docker 
sudo pip3 install requests==2.14.2

Update default Python version.

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2

Install docker-compose Python module matching your Docker Compose version.

$ docker-compose version
docker-compose version 1.24.1, build 4667896
docker-py version: 3.7.3
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.1.0j  20 Nov 2018

$ sudo pip3 install docker-compose==1.24.1

Clone AWX source code from GitHub using the git command.

sudo su -
git clone --depth 50 https://github.com/ansible/awx.git

Change to the AWX installer directory

Since you need to execute ansible playbooks under installer directory, first navigate to this directory.

cd awx/installer/

Check the inventory file in the awx directory, you can customize as you want:

$ nano inventory

Generate AWX secret key

$ pwgen -N 1 -s 30
2fCkx2K5GnIjBz4OterhOC3ey0WPdj

Modify inventory file with correct settings for your setup. Minimal settings:

dockerhub_base=ansible
awx_task_hostname=awx
awx_web_hostname=awxweb
postgres_data_dir=/tmp/pgdocker
host_port=80
host_port_ssl=443
docker_compose_dir=/tmp/awxcompose
pg_username=awx
pg_password=awxpass
pg_database=awx
pg_port=5432
rabbitmq_password=awxpass
rabbitmq_erlang_cookie=cookiemonster
admin_user=admin
admin_password=StrongAdminpassword
create_preload_data=True
secret_key=2fCkx2K5GnIjBz4OterhOC3ey0WPdj

Execute playbook

Install Ansible AWX on Debian 10 using Ansible- The playbook name is install.yml.

ansible-playbook -i inventory install.yml

Installation output, check if you got any error messages.

Use the docker ps command to get a list of running containers.

Step 5: Access Ansible AWX Dashboard

The web portal is accessible via hostip_or_hostname. You will get a welcome dashboard similar to one below.

Login with admin user account password set in the inventory file. Once you authenticate, you’ll get to AWX administration dashboard.

Step 6: Updating Ansible AWX on Debian 10

To make updates, change your working Directory to AWX home.

cd ~/.awx/awxcompose/

Stop Docker services.

# docker-compose stop
Stopping awx_task      ... done
Stopping awx_web       ... done
Stopping awx_rabbitmq  ... done
Stopping awx_postgres  ... done
Stopping awx_memcached ... done

Re-pull Docker images.

# docker-compose pull
Pulling rabbitmq  ... done
Pulling memcached ... done
Pulling postgres  ... done
Pulling web       ... done
Pulling task      ... done

Start AWX docker services.

# docker-compose up --force-recreate -d
Recreating awx_postgres  ... done
Recreating awx_rabbitmq  ... done
Recreating awx_memcached ... done
Recreating awx_web       ... done
Recreating awx_task      ... done

Related guides.

Install Ansible AWX on Ubuntu

How To Install and Configure Ansible Tower on CentOS 7

Install Ansible AWX on CentOS 7 / Fedora

Semaphore – Manage Ansible Tasks from A Web UI