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.
First things first, update the OS and reboot.
$ sudo yum -y update $ sudo reboot
Install requisite base packages
$ sudo yum -y install bzip2 device-mapper-persistent-data gcc gcc-c++ git gettext lvm2 yum-utils docker-compose
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
Install Ansible and pip.
$ sudo yum -y install ansible python-pip
Set up Docker CE.
$ sudo yum -y install docker-ce $ sudo systemctl enable docker $ sudo systemctl start docker
Install docker-compose via yum.
$ sudo yum -y install docker-compose
OPTIONAL: You can check and customize deployment variables via the inventory file.
$ vi inventory
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
Monitor the migration.
$ docker logs -f awx_task
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.)
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.
docker psto get the name of the existing container
- Use the command
docker exec -it /bin/bashto get a bash shell in the container
- Generically, use
docker exec -itto 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
Each project you create should have a folder in the projects directory