Introduction

When Red Hat acquired Ansible in 2015 it was just a matter of time before the commercial component, Ansible Tower, was open sourced. This past August that came to pass with Red Hat finally releasing the the Tower upstream, AWX, on GitHub.

While I didn’t have much luck with the initial releases, more recently I revisited the project after attending an Ansible Workshop. What follows is the quickest build I found to get up and running on a CentOS 7 minimal server install.

Please note that for playing around you can get away with a lot less than the recommended 10GB available for /var, but the bare minimum is 3-4GB. However, stick to the 4GB RAM recommendation if you can to keep things running smooth.

Sources

AWX Project on GitHub

AWX Install Gist by dougbtv

Instructions

  1. First things first, update the OS and reboot.

    $ sudo yum -y update
    $ sudo reboot
    
  2. Install requisite base packages

    $ sudo yum -y install bzip2 device-mapper-persistent-data gcc gcc-c++ git gettext lvm2 yum-utils docker-compose
    
  3. Add the EPEL and Docker repositories

    $ sudo yum -y install epel-release
    $ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    $ sudo yum -y update
    
  4. Install Ansible and pip.

    $ sudo yum -y install ansible python-pip
    
  5. Set up Docker CE.

    $ sudo yum -y install docker-ce
    $ sudo systemctl enable docker
    $ sudo systemctl start docker
    
  6. Install docker-compose via yum.

    $ sudo yum -y install docker-compose
    
  7. OPTIONAL: You can check and customize deployment variables via the inventory file.

    $ vi inventory
    
  8. As root, clone and deploy AWX to Docker containers via Ansible.

    $ git clone --depth 50 https://github.com/ansible/awx.git
    $ cd awx/installer/
    $ ansible-playbook -i inventory install.yml
    
  9. Monitor the migration.

    $ docker logs -f awx_task
    
  10. Once you start seeing the awx.main.scheduler running Tower task manager you are up. Point your browser to the server and you should get the AWX login page. The default user is admin and the password is password(unless you changed it in the inventory file in step 7.)

  11. SSH into a Container

    How do I SSH into a running container

    There is a docker exec command that can be used to connect to a container that is already running.

    • Use docker ps to get the name of the existing container
    • Use the command docker exec -it /bin/bash to get a bash shell in the container
    • Generically, use docker exec -it  to execute whatever command you specify in the container.

 

Use the command
docker exec -it awx_web /bin/bash
to get a bash shell in the container

Once in the awx_web docker container create a Projects directory
mkdir /var/lib/awx/projects

Each project you create should have a folder in the projects directory