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

Share on:

James Kiarie, a certified Linux administrator and a passionate tech enthusiast who stays connected with the latest trends in the tech world. Beyond executing commands on the terminal, you'll find me enjoying some cool music, taking casual strolls, or indulging in a good movie.

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

  1. Hey James

    great post so far, i’m up to reviewing the installer process.

    Interestingly there is no installer directory in the awx directory.

    have cross checked with github and there is no installer directory there either.

    any ideas?

    “”Cheers
    G

    Reply
    • Hi Gerardo,
      We have fixed the issue that you have mentioned. In place of cloning we have downloaded the AWX zip file from the github. Same steps have been updated in article too.

      Reply
    • ‘https://github.com/ansible/awx/blob/devel/CHANGELOG.md’

      Saw some updates from 18 ver-Removed installer directory.

      Reply
  2. Hey Gerardo, I’m equally stunned to confirm your observation. It appears something changed with the AWX Github repository from the time this guide was published and now. That could be the only plausible explanation. At the time of writing this guide, everything was working as expected.

    Reply
  3. Thanks for post James, really useful to an AWX beginner like me. I did get stuck when trying to follow Pradeeps post on how to create projects, turns out i had to manually create the /var/lib/awx/projects folder and then uncomment ‘project_data_dir=/var/lib/awx/projects’ in the inventory file. Not sure if thats useful to anyone (i got stuck for a while).

    Reply
  4. Great post, thanx! Everyting installed, but there is a bug in awx 17.1 – ‘https://github.com/ansible/awx/issues/9043/’
    It’s rather critical when use inventory from git. There is solution to use F12 in browser, but its painful 🙂

    workaround:
    i delete containers docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)
    and rerun step with git awx download, but use awx 15 version:
    wget ‘https://github.com/ansible/awx/archive/15.0.0.zip’
    edit inv and run, bug is gone.

    Reply
  5. Hi James,
    Thanks a lot for the document it really helped me to launch the AWX UI. I tried a lot with minikube with 18.0 and faced lot many issues and finally got yours and saved time as well as me.
    Thanks & Regards,
    Durga cherukuri

    Reply
  6. I’m facing the below problem while running the install.yml file,

    ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

    The error appears to have been in ‘/home/saurabh.pande/awx/installer/roles/local_docker/tasks/upgrade_postgres.yml’: line 39, column 3, but may be elsewhere in the file depending on the exact syntax problem.
    The offending line appears to be:
    – name: Stop AWX before upgrading postgres
    ^ here

    Reply
  7. Hey guys, thank you very much for this guide.
    It saved me alot of time, as I am a linux/ansible/awx beginner.
    I was able to get this running with AWX version 17.0.1 (as described in the post).
    Then I tried to use the current version (19.0.0) and as others already stated, there is no installer folder.
    Does anyone know how to use this guide with newer versions of AWX?
    Thanks very much for any hint on this!

    Reply
    • From version 18.x, AWX uses kubernetes/minikube and not docker, so the install procedure is totally different.
      I have hopes that someone might make a howto for setting up awx in a kubernetes cluster, as the cluster is pretty easy to get up and running.

      Reply
  8. Thanks James for this nice document.
    In this version ‘17.1.0’, I am not able to see the filter option in jog logs output on the dashboard. Is it not part of this version, any idea?

    Reply
  9. Help! Followed the steps and I got stuck on Step 7.
    It seemed my instance got hung up. I tried running another ssh session of the instance it does not connect.
    These are the last parts.

    TASK [local_docker : Run migrations in task container] *************************

    ^[[A^[[A^[[A^[[A

    ********
    changed: [localhost]
    ********
    changed: [localhost]
    ********
    changed: [localhost]

    It seems not moving anymore.

    Reply
    • Hi Janus,

      Is your system have enough resources to run AWX ? By looking at the logs that you have shared is not giving any hint.

      Reply
  10. Hello,

    This worked great, minus a few hiccups.
    Important notes: If you do not have unzip, you will need to install it – ‘ apt install unzip’. Also before running the inventory playbook, make sure the directory path exists – /var/lib/awx/projects (which is the default path). For some reason, it did not create this path automatically.
    Thanks for this tutorial!

    Reply

Leave a Comment