Multiple people handling multiple servers or environments usually requires a good setup strategy with a good looking GUI. This is where Ansible AWX comes in.

AWX is an open source community project, which is an alternative to the payed version – Ansible Tower. Read more here -> https://www.ansible.com/products/awx-project/faq

In this section we’ll cover deploying AWX on a dedicated cloud VPS. We’ll be using CentOS 7. After the deployment we’ll go over the basics on using AWX to run a simple playbook.

Let’s start with installing AWX. Since we want to keep things simple and benefit from code reuse, we’ll be using Geerling Guy’s AWX role: https://galaxy.ansible.com/geerlingguy/awx
(At this point I’d like to recommend a great book – “Ansible for DevOps” by Jeff Geerling, if you wish to learn Ansible in depth).

There are prerequisites that need to be addressed when configuring applying above role. It’s all well described in the role’s README file.

The playbook we’ll be using is a very simple one (make sure you have all the necessary roles downloaded or preinstalled with ansible-galaxy). We will be using python3 on the target machine to deploy AWX.

Note that the geerlinguy.awx role actually downloads the ansible AWX install playbook from the main AWX repository (https://github.com/ansible/awx.git) and runs it with the inventory configured within the repo (inventory file).

Here is the playbook:

– hosts: awx.test.local
become: true
vars:
nodejs_version: “6.x”
pip_package: python3-pip
pip_install_packages:
– name: docker-compose
roles:
– geerlingguy.repo-epel
– geerlingguy.git
– geerlingguy.ansible
– geerlingguy.docker
– geerlingguy.pip
– geerlingguy.nodejs
– geerlingguy.awx

Running the playbook:

[root@ansible ca]# ansible-playbook awx.yml
PLAY [awx.test.local] ******************************************************************************************************************************************
TASK [Gathering Facts] *****************************************************************************************************************************************
ok: [awx.test.local]
TASK [geerlingguy.repo-epel : Check if EPEL repo is already configured.] ***************************************************************************************
ok: [awx.test.local]
TASK [geerlingguy.awx : Clone AWX into configured directory.] **************************************************************************************************
skipping: [awx.test.local]
TASK [geerlingguy.awx : Run the AWX installation playbook.] ****************************************************************************************************
changed: [awx.test.local]
TASK [geerlingguy.awx : Create a file to mark whether this playbook has completed.] ****************************************************************************
ok: [awx.test.local]
PLAY RECAP *****************************************************************************************************************************************************
awx.test.local : ok=30 changed=1 unreachable=0 failed=0 skipped=33 rescued=0 ignored=0

After the playbook has run through, AWX is ready: navigate to http://awx.test.local and login with defaults:
Username: admin
Password: password

Voila! The main dashboard is displayed. Now we are ready to start managing our infrastructure through AWX!

Here we explain how to run a simple playbook from AWX.