top of page

How to Install AWX on Ubuntu 20.04 using Vagrant & VirtualBox

What is AWX

AWX is a web application (open-source) that provides user interfaces (UI), REST API and task engine for Ansible. It is an open-source community project, sponsored by Red Hat, that enables users to better control their Ansible project use in IT environments. AWX is the upstream project from which the Red Hat Ansible Tower offering is ultimately derived. In this blog, we will see how to install it on ubuntu box using vagrant.

Technology

  1. Ansible

  2. Docker

  3. Docker-compose

  4. Vagrant

  5. Visual Studio Code

  6. Ubuntu 20.04

  7. Git/GitHub

Prerequisites

Make sure you following software installed on your local system.

  1. Oracle VirtualBox.

  2. Vagrant

Before going to install AWX, Let us follow the steps to install & configure our Ubuntu machine.

  1. First, create a folder in VS code by name “myubuntu” (you can give whatever name you want).

  2. Next, create file called “Vagrantfile” inside the folder created before. Copy & paste the following content inside the Vagrantfile.

Vagrant.configure("2") do |config|config.vm.define "vm1" do |vm1|vm1.vm.box = "bento/ubuntu-20.04"config.vm.network "private_network", ip: "192.168.20.30"config.vm.synced_folder ".", "/vagrant_data"endend

3. In the terminal window of VS code, run the command “vagrant up vm1”. Wait for few minutes for your ubuntu box to come up.

4. Next, in your VirtualBox settings, change the default base memory to “4096” & no of processors to “2”. Now you are good to go to install AWX on your virtual ubuntu machine.

5. Let us login into the newly created virtual machine by issuing the command “vagrant ssh vm1”. Inside your virtual machine issue the command “cd /vagrant_data/”. So, inside this directory we are going to issue commands to install AWX.


Steps to install AWX on Ubuntu box

Step 1: Installing Ansible

To install the ansible on ubuntu box, run the following commands.

sudo apt update -y

sudo apt install software-properties-common -y

sudo apt-add-repository –yes –update ppa:ansible/ansible

sudo apt install ansible -y


Step 2: To update system & to install the required packages, run the following commands.

1. sudo su

2. apt-get update -y

3. sudo apt-get install \

    apt-transport-https \

    ca-certificates \

    curl \

    gnupg \

    lsb-release

4. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg –dearmor -o /usr/share/keyrings/docker-archive-  keyring.gpg

5. echo \

  “deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \

 $(lsb_release -cs) stable” | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null


Step 3: Install Docker & Docker-compose.

To install the docker & docker-compose, run the following commands.

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io -y

sudo apt install docker-compose -y

Step 4: Clone the AWX repository.

To clone AWX repository & check out to particular branch , run the following commands

cd awx/

git checkout tags/17.0.1 -b 17-branch


Step 5: Generate Secrete key & Edit the inventory file

To generate secrete key & edit the inventory file, run the following command.

openssl rand -hex 32

cd installer/

nano inventory

In the inventory file, uncomment the  admin_password=password line & replace the secret_key value with the new value as generated above and save the file.


Step 6: Finally, run the playbook to install AWX.

To run the playbook, make sure you are in installer directory & run the following command.

ansible-playbook -i inventory install.yaml

Now go to your browser enter the private ip of your ubuntu box, you can see AWX is up & running. Congratulations! You have successfully installed AWX on your Ubuntu box.


5 views0 comments

Comments


bottom of page