Welcome to today’s article on how to install, configure and use Ansible AWX on Kubernetes / OpenShift Cluster. Ansible AWX is a popular web-based platform created to provide a user-friendly interface for Ansible automation operations. AWX is built on top of the Ansible project and it gives you a centralized management for all Ansible inventories and playbooks.

From the dashboard you can manage inventory, run and schedule Ansible playbooks, monitor job activity and execution results. The built-in RBAC (role-based access control) is used for managing access to resources within AWX platform. An integration with other tools such as Git for version control is also possible.

Key features of Ansible AWX:

  • Centralized management: It offers centralized management for Ansible playbooks and inventories for ease of administration.
  • Role-based access control: With the built-in RBAC you can ensure there is a secure and efficient management of automation tasks.
  • Web-based user interface: AWX comes with an intuitive user-friendly web interface for managing Ansible playbooks, inventory, and automation tasks.
  • Third-party integrations: Integration with other tools such as Git for version control can be done making it easy to manage and track changes to Ansible playbooks over time.
  • Reporting and analytics: AWX has reporting and analytics capabilities for tracking performance and gains from its use.

Run Ansible AWX on Kubernetes / OpenShift Cluster

In this section we’ll cover the full process of installing Ansible AWX on Kubernetes / OpenShift Cluster. A major pre-requisite for this operation is existing Kubernetes / OpenShift cluster.

Step 1: Deploy Kubernetes Cluster

You can use existing articles on our website to setup a cluster.

Once the cluster is deployed and running confirm using kubectl command:

$ kubectl cluster-info
Kubernetes control plane is running at https://api.k8s.cloudlabske.io:6443

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Step 2: Deploy MetalLB / Ingress solution

For Kubernetes clusters deployed on your on-prem infrastructure you’ll need a solution that provides Load Balancing feature and Ingress solution. For managed Kubernetes clusters such as ones provided by cloud providers like EKS, AKS and GKE, a manual setup is not required for LB.

We have existing articles on this setup.

Step 3: Configure Persistent Storage Solution

We’ll need persistent storage for AWX data. Any solution integrated to Kubernetes can be used for this. Refer to some of the guides available in our website.

In this setup we’re using NFS storage class to automatically provision persistent volumes on Kubernetes.

$ kubectl get sc
NAME               PROVISIONER          RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
nfs-01 (default)   nfs-provisioner-01   Delete          Immediate           true                   53d

This will be used when deploying AWX on Kubernetes / OpenShift cluster.

Step 4: Deploy AWX Operator on Kubernetes

We shall use the AWX Kubernetes Operator meant to be deployed in your Kubernetes cluster(s) and can manage one or more AWX instances in any namespace.

Install git and make tools:

### Ubuntu / Debian ###
sudo apt update
sudo apt install git build-essential curl jq  -y

### RHEL based systems ###
sudo yum -y install epel-release
sudo yum group install "Development Tools"
sudo yum install curl jq

Use git to clone Operator project source to your workstation with kubectl configured.

$ git clone https://github.com/ansible/awx-operator.git
Cloning into 'awx-operator'...
remote: Enumerating objects: 7925, done.
remote: Counting objects: 100% (403/403), done.
remote: Compressing objects: 100% (256/256), done.
remote: Total 7925 (delta 187), reused 316 (delta 121), pack-reused 7522
Receiving objects: 100% (7925/7925), 2.19 MiB | 739.00 KiB/s, done.
Resolving deltas: 100% (4498/4498), done.

Next we create a namespace where operator will be deployed. We’ll name this awx: