Debian 12 bookworm
Sponsored Link

Ansible : Install AWX2023/08/01


Install Ansible AWX that is the community edition of Red Hat Ansible Tower.

To install Ansible AWX, it needs Kubernetes infrastructure.
It's OK with not full Kubernetes cluster but MicroK8s, K3s or Minikube and so on.
Understandably, RedHat OpenShift or OKD that is the community edition of OpenShift are also ready.


On this example, use Minikube for AWX.
So install Minikube like here.

[2] Install other required packages.
apt -y install git make curl
[3] Start Minikube as a common user.
minikube start --vm-driver=kvm2 --cpus=4 --memory=8g --addons=ingress

* minikube v1.31.1 on Debian 12.1 (kvm/amd64)
* Using the kvm2 driver based on user configuration
* Downloading VM boot image ...
    > minikube-v1.31.0-amd64.iso....:  65 B / 65 B [---------] 100.00% ? p/s 0s
    > minikube-v1.31.0-amd64.iso:  289.20 MiB / 289.20 MiB  100.00% 26.20 MiB p


* Verifying Kubernetes components...
* Verifying ingress addon...
* Enabled addons: storage-provisioner, default-storageclass, ingress
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

minikube status

type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

kubectl get pods -A

NAMESPACE       NAME                                        READY   STATUS      RESTARTS      AGE
ingress-nginx   ingress-nginx-admission-create-pfl2v        0/1     Completed   0             60s
ingress-nginx   ingress-nginx-admission-patch-thrkd         0/1     Completed   1             60s
ingress-nginx   ingress-nginx-controller-7799c6795f-9gnp8   1/1     Running     0             59s
kube-system     coredns-5d78c9869d-7t2r7                    1/1     Running     0             59s
kube-system     etcd-minikube                               1/1     Running     0             75s
kube-system     kube-apiserver-minikube                     1/1     Running     0             72s
kube-system     kube-controller-manager-minikube            1/1     Running     0             73s
kube-system     kube-proxy-sjmvd                            1/1     Running     0             59s
kube-system     kube-scheduler-minikube                     1/1     Running     0             72s
kube-system     storage-provisioner                         1/1     Running     1 (29s ago)   71s
[4] Deploy Ansible AWX.
# get AWX Operator first

git clone

Cloning into 'awx-operator'...
remote: Enumerating objects: 7311, done.
remote: Counting objects: 100% (318/318), done.
remote: Compressing objects: 100% (193/193), done.
remote: Total 7311 (delta 119), reused 264 (delta 100), pack-reused 6993
Receiving objects: 100% (7311/7311), 2.04 MiB | 4.49 MiB/s, done.
Resolving deltas: 100% (4131/4131), done.

cd awx-operator
# specify a version of AWX Operator
# make sure versions :

git checkout 2.5.0

Note: switching to '2.5.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c 

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at dc2599b Docs: added contributing segment to docs (#1483)

# set any namespace you like for AWX and deploy Operator

export NAMESPACE=ansible-awx

make deploy

namespace/ansible-awx created created created created
serviceaccount/awx-operator-controller-manager created created created created created created created created
configmap/awx-operator-awx-manager-config created
service/awx-operator-controller-manager-metrics-service created
deployment.apps/awx-operator-controller-manager created

kubectl get pods -n $NAMESPACE

NAME                                               READY   STATUS    RESTARTS   AGE
awx-operator-controller-manager-66c5b94884-2bxpj   2/2     Running   0          82s

cp awx-demo.yml ansible-awx.yml

vi ansible-awx.yml
# change to any service name you like

kind: AWX
  name: ansible-awx
  service_type: nodeport

# set namespace for AWX you set to kubectl context and deploy AWX

kubectl config set-context --current --namespace=$NAMESPACE

Context "minikube" modified.
kubectl apply -f ansible-awx.yml created
# possible to see installation progress on the logs

kubectl logs -f deployments/awx-operator-controller-manager -c awx-manager


----- Ansible Task Status Event StdOut (, Kind=AWX, ansible-awx/ansible-awx) -----

PLAY RECAP *********************************************************************
localhost                  : ok=81   changed=0    unreachable=0    failed=0    skipped=81   rescued=0    ignored=1

{"level":"info","ts":"2023-08-01T01:08:32Z","logger":"KubeAPIWarningLogger","msg":"unknown field \"status.conditions[1].ansibleResult\""}

# that's OK if finished with [failed=0]

kubectl get pods -l ""

NAME                                READY   STATUS    RESTARTS   AGE
ansible-awx-postgres-13-0           1/1     Running   0          7m30s
ansible-awx-task-6dbcb97849-cdr2q   4/4     Running   0          6m51s
ansible-awx-web-68f58f9b8-j5znv     3/3     Running   0          5m30s

kubectl get service -l ""

NAME                      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
ansible-awx-postgres-13   ClusterIP   None            <none>        5432/TCP       8m
ansible-awx-service       NodePort   <none>        80:30115/TCP   7m23s

# display service URL

minikube service ansible-awx-service --url -n ansible-awx
# confirm password for admin account

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

# if you access from outside of Kubernetes cluster, it needs to set port forwarding
# [10445] ⇒ the port that Minikube installed host listens ⇒ specify any free port you like
# [80] ⇒ the port AWX container listens

kubectl port-forward service/ansible-awx-service --address 10445:80

Forwarding from -> 8052
[5] Access to Ansible AWX with Web browser.
If you access from Minikube installed localhost, specify the service URL confirmed above.
If you set port forwarding, access to the URL [http://(Minikube installed hostname or IP address):(forwarding port)] on any computer in your local network.
After successfully accessed, AWX login form is shown.
It's possible to login with user [admin] and its password is the one you confirmed above.
[6] If successfully logined, Ansible AWX Dashboard is displayed. That's OK to install AWX.
Matched Content