Install Ansible AWX 17.0.1 on Ubuntu 20.04 using Docker
AWX is the upstream open source version of Ansible Tower, you can install it for free and use it for free forever. However there is no support. If you wanted a supported version you need to look at Ansible Tower
For this tutorial I am going to be installing AWX 17.0.1 on an Ubuntu Desktop 20.04 running within VMWare workstation
Full install instructions can always be found here – https://github.com/ansible/awx/blob/devel/INSTALL.md
I am starting from a clean Ubuntu installation and all I have done is update any packages with
sudo apt update && sudo apt -y upgrade sudo reboot
I have also installed VMWare tools, net-tools, Git SSH and Virtualenv
sudo apt install open-vm-tools-desktop sudo apt install net-tools sudo apt install git sudo apt install python3-virtualenv
Setup Virtual Environment
We now need to setup a virtual environment
I will make a directory called virtual and then create a virtual environment within that directory called awx
mkdir virtual cd virtual virtualenv awx
I now need to activate that virtual environment
Your prompt should now change to this
sudo apt -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER newgrp docker
Check Docker version
Install Docker Compose
We now need to install docker-compose, in doing so it will also install Docker, which is also another requirement.
pip3 install docker-compose
We now need to clone the AWX repository from Github, make sure you drop back to your home directory before doing this otherwise you will get an error saying the folder awx already exists
git clone -b 17.0.1 https://github.com/ansible/awx.git
Edit the Inventory file
You now have a folder called awx and within there a folder called installer and within there an inventory file you need to edit.
You just need to make sure you have set an admin password and we need to change the directory of your virtual environment.
Change # admin_password=password to
admin_password=(your secure password)
Find this line
AWX custom virtual environment folder. Only usable for local install.
custom_venv_dir=/opt/my-envs/ and change the path to /home/roger/virtual/awx (make sure you change your local username!)
To build AWX you need to have Ansible installed to run the install playbook, make sure you are in your virtual environment and run
pip3 install ansible
Run the install Playbook
ansible-playbook -i inventory install.yml
If everything is in place this should run fully – watch out for any red!
This will take a little while to run through as it has to pull some images from Docker, but once it completes you should be able to type docker ps and see your running containers
You can now log into your AWX – point your browser to the IP address of your AWX and you should see this screen
Docker support has been removed for Ansible AWX so this process might not run for you at a later date if you try to use newer versions.
It is discussed here – https://groups.google.com/g/awx-project/c/47MjWSUQaOc/m/bCjSDn0eBQAJ
Remember that there is no support with AWX and if you get stuck there is always the Ansible community. If you are looking for a more enterprise friendly tool Ansible Tower might be a better fit, you you do have to pay for a subscription which gets you support.
A lot of companies use AWX with great success, so why not install it and give it a go.