Table of Contents

Presentation

qclug_awx.pdf qclug_awx.odp

These steps were taken mostly from the upstream installation doc found here:

https://github.com/ansible/awx/blob/devel/INSTALL.md

Install Docker and AWX deps

# sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# echo 'deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable' | sudo tee /etc/apt/sources.list.d/docker.list
# sudo apt-get update && sudo apt-get install docker-ce python-virtualenv python python-dev build-essential git

Clone AWX

# git clone https://github.com/ansible/awx.git
# cd awx
# git checkout -b 1.0.6 1.0.6

Create a virtualenv and install ansible

# virtualenv -p `which python2` venv
# source venv/bin/activate
# pip install ansible docker-py

Configure AWX installation

# cd installer
# vim inventory

Set the postgres variables and optionally set pg_hostname if an external database is desired, otherwise if left commented out a new postgres database will be created locally in a separate container.

# pg_hostname=postgresql
pg_username=awx
pg_password=<secret>
pg_database=awx
pg_port=5432

Set the default admin username and password

default_admin_user=admin
default_admin_password=<secret>

Also set the secret_key to something unique

secret_key=<secret_key>

Install AWX

# ansible-playbook -i inventory install.yml

Add/Import inventory

Login to the awx_web container

# docker exec -it awx_web bash

Create the following directory/file structure (or use your existing inventory structure…)

inventory/               <- directory
├── group_vars           <- directory
│   ├── all              <- file
│   └── production       <- file
├── host_vars            <- directory
│   └── 172.17.0.1       <- file
└── production           <- file

Use awx-manage to import the inventory

# cd inventory
# awx-manage inventory_import --source=./ --inventory-id=1 --overwrite

Browse to the following URL to view.

http://localhost/#/inventories/inventory/1

Add an SSH key/credential to AWX

Add Project/ansible code to AWX

Create Job Template

Execute job using the AWX dashboard

Execute Job via API