Ansible is an open-source software provisioning, configuration management, and application-deployment tool that allows configuration managers painless processes to manage and deploy applications and services across diverse environments. AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. Both work together to provide a web-based portal to manage and automate Ansible. AWX allows you to easily and centrally manage Ansible playbooks, inventories, Secrets, and scheduled jobs from a web interface. To get started with installing Ansible AWX on Ubuntu, follow the steps below:
Install Docker and Docker Compose
Docker has two editions: The Enterprise Edition (EE) and the Community Edition (CE). For this tutorial, we’re going to be installing the community edition of Docker. If you always want to automatically get the latest version of Docker on Ubuntu, you must add its official repository to the Ubuntu system. To do that, run the commands below to install prerequisite packages. Next, run the commands below to download and install Docker’s official GPG key. The key is used to validate packages installed from Docker’s repository making sure they’re trusted. You should see an output shown below: Now that the official GPG key is installed, run the commands below to add its stable repository to Ubuntu. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. At this point, Docker’s official GPG and repository should be installed on Ubuntu. For those who currently have older versions of Docker, run the commands below to remove them. When you have removed all previous versions of Docker, run the commands below to install the latest and current stable version of Docker. To install a specific version of Docker, run the apt-cache command. Then select the version to install. Now to install a specific version, run the commands below with the version you wish to install If you just want to latest version without specifying the above, run the commands below. The command below will always install the highest possible version. That should install Docker software on Ubuntu. Add your account to the Docker group and restart. Verify that Docker CE is installed correctly by running the hello-world image, run the commands below: You should see a similar line below: Docker is installed correctly!
Install Docker Compose
On Ubuntu Linux, you can download the Docker Compose binary from the Compose repository release page on GitHub. To install it, run the commands below to download version 1.24.0. As of this writing, this was the current version. To install a different version of Compose, substitute 1.24.0 with the version of Compose you want to use. After downloading it, run the commands below to apply executable permissions to the binary file and create a symbolic link to /usr/binary That should get Docker Compose working. To test, run the commands below: You should see similar output as below: This is how to install Docker and Docker Compose on Ubuntu
Install Ansible
Now that Docker and Docker Compose are installed, use the commands below to install the latest version of Ansible. After installing, you can use the commands below to verify that Ansible is installed and show its version number. The commands should output similar lines as shown below
Install AWX
At this point, Docker, Docker Compose, and Ansible should be installed. Next, follow the steps below to install AWX. First, install and configure a few prerequisite packages. Next, clone the AWX source code from GitHub using the git command. Change into the installer folder Generate AWX secret key using the commands below. You’ll need this key in the configuration file below: It should output a string similar to the one below. Copy and save it somewhere. After that, open the inventory file and add the secret key generated above and save the file. Edit the highlighted line and save the file Next, run the ansible-playbook command below to install and configure its environment. The name of the playbook file is install.yml. After a brief moment, the setup should be complete. When done, open your browser and browse to the server hostname or IP address. That should bring up the AWX portal to log in. Log in with the username and password in the configuration file above. The default is admin and password Enjoy! Conclusion: This post showed you how to install and configure Ansible AWX on Ubuntu 18.04 | 16.04. If you find any error above, please use the comment form below to report. thanks, You may also like the post below: