How to Install Ansible AWX on Ubuntu 22.04 | 20.04

Ansible AWX is a free and opensource front-end web application that provides a user interface to manage Ansible playbooks and inventories, as well as a REST API for Ansible. It is an open source version of Red Hat Ansible Tower.

In this post we will show you how to install Ansible AWX on Ubuntu 22.04 or Ubuntu 20.04. In order to deploy AWX, it needs some Kubernetes Infrastructure like MicroK8s, K3s or Minikube. In this demo we will be using minikube ( A Single node Kubernetes cluster). Use the following URL for minikube installation,

Prerequisites

Before we get started, ensure that Ubuntu 22.04 or 20.04 system has the following:

  • 4 GB of RAM
  • 3.4 GHz CPU with 2 Cores
  • Hard disk space 20 GB
  • Internet Connection
  • Pre Installed minikube

Let’s jump into Ansible AWX installation steps

Step 1) Install Required Packages

Log in to your Ubuntu system and install following required packages

$ sudo apt install git make -y

Step 2) Start minikube cluster

To start the minikube, run following minikube command as regular user,

$ minikube start --vm-driver=docker --addons=ingress

Start-Minikube-for-Ansible-AWX-Ubuntu

Execute beneath commands to verify minikube and pods status

$ minikube status
$ kubectl get pods -A

Minikube-Pods-Status-Ubuntu

Step 3) Deploy Ansible AWX via Operator

Use following git command to get AWX operator,

$ git clone https://github.com/ansible/awx-operator.git
$ cd awx-operator/
$ git checkout 2.4.0

Git-Clone-AWX-Operator-Ubuntu

Note: At the time of writing this post, latest version of AWX operator was 2.4.0. You can check operator version from “https://github.com/ansible/awx-operator/releases”.

Next , set the namespace “ansibe-awx” and run make deploy command

$ export NAMESPACE=ansible-awx
$ make deploy

make-deploy-awx-minikube

check the status pods from ansible-awx namespace,

$ kubectl get pods -n ansible-awx

AWX-Operator-Pod-Status

Deploy AWX using following command,

Deply-AWX-Yaml-Minikube-Ubuntu

Monitor pods and service status of ansible-awx namespace,

$ kubectl get pods -n ansible-awx
$ kubectl get svc -n ansible-awx

Ansible-AWX-Pods-Service-Minikube-Ubuntu

Great, output above confirms that AWX pods and service are up and running.

You can track the installation for AWX from pod,

$ kubectl logs awx-operator-controller-manager-6c58d59d97-vvkvc -n ansible-awx -f

Replace pod name as per your setup.

Step 4) Access AWX Dashboard

To access the dashboard from Ubuntu system itself, run following command to get dashboard url,

$ minikube service awx-demo-service --url -n ansible-awx
http://192.168.49.2:30182
$

In case, you are trying to access outside of your ubuntu system then run following kubectl command,

$ kubectl port-forward service/awx-demo-service -n ansible-awx --address 0.0.0.0 10445:80

AWX-Dashboard-URL-Minikube-Ubuntu

Open the web broswer, type following URL

http://<Ubuntu-System-IP-Address>:10445

AWX-Login-Page-Minikube-Ubuntu

To retrieve admin user password, run the following kubectl command,

$ kubectl get secret awx-demo-admin-password -o jsonpath="{.data.password}" -n ansible-awx | base64 --decode; echo
7EliSIHKyM28KLQQcZ2zBzdKWGlnz6JM
$

AWX-Admin-User-Password-Ubuntu

Copy this password string and paste it on password field on AWX login page,

Password-Admin-User-AWX-Minikube

Click on ‘Login In

Ansible-AWX-Dashboard-Minikube-Ubuntu

And there you have it. We have successfully installed AWX on Ubuntu 22.04 and 20.04. I hope you found this post useful and informative. Kindly do post your queries and feedback in below comments section.

Also Read : How to Run and Schedule Ansible Playbook Using AWX GUI

27 thoughts on “How to Install Ansible AWX on Ubuntu 22.04 | 20.04”

  1. Many thanks for this great effort! The only problem I had was after stopping nginx, there was no more failure. I was then able to access the AWX website.

    Reply
  2. Hello Everyone, Can someone guide me how add route to access the Ansible clients from the AWX server? Thanks in advance.

    Thanks,
    Sunil.K

    Reply
  3. Docker Compose Install did not work for me because the 2nd grep failed due to “Linux” being lowercase “l”. Once I changed it to lowercase, the step passed.

    The step: $ curl -s ‘https://api.github.com/repos/docker/compose/releases/latest’ \
    | grep browser_download_url | grep docker-compose-Linux-x86_64 \
    | cut -d ‘”‘ -f 4 | wget -qi –

    Reply
  4. Just wanted to confirm if there is bug in this version . I have installed awx using container and version is 17.1.0.
    Many of the things are performing in weird way or sometimes not even giving output or error

    Reply
  5. Actual script:
    sudo apt install curl git python3-pip pwgen

    curl -sSL ‘https://get.docker.com’ | sh
    sudo usermod -aG docker $(whoami) && exit
    sudo apt install docker-compose nodejs npm ansible -y
    docker-compose version

    sudo npm install npm –global
    git clone -b 17.1.0 ‘https://github.com/ansible/awx.git’
    cd awx/installer
    pwgen -N 1 -s 30
    nano inventory

    ansible-playbook -i inventory install.yml

    Reply
  6. Hi James,

    Now is 2023 July, and probably lots of stuff have changed. I followed your steps and I have a bucket load of errors on the last step (ansible-playbook -i inventory install.yml). I am a newbie in AWX. My question is do you maintain this page?

    Reply
  7. I have already a working AWX instance and so far everything works great. One question I have is how can I check which python modules have been installed? For example I would like to use winrm for Windows hosts management. If the python modules are mot present, how we can add them to this setup?

    Reply
  8. Good afternoon, great how to, just to complement, if you use kubectl port-forward service/awx-demo-service -n ansible-awx –address 0.0.0.0 10445:80 , it will get the terminal stuck and it keeps listening,
    Handling connection for 10445
    Handling connection for 10445
    Handling connection for 10445

    To solve it, just run it with the option ( &> /dev/null & ), example below.
    kubectl port-forward service/awx-demo-service -n ansible-awx –address 0.0.0.0 10445:80 &> /dev/null &

    Reply
    • Hi Jose,

      After following all procedures i’m successfully able to install AWX and login page loads but when i’m giving the credentials it’s getting error like invalid username or password error . Please let us know what’s the solution for this .

      Reply

Leave a Reply to JPanda Cancel reply