Skip to main content

AWX (Ansible automation)

Self-hosted AWX (24.6.1, Apache 2.0) — web UI, REST API and task engine built on top of Ansible, used to run playbooks, schedule jobs and manage inventories and credentials centrally.

Guestsrv-auto — Rocky Linux 9.8, VM 122 on rumba, 192.168.88.38, 8 vCPU, 8 GB RAM, 60G (local-lvm, scsi0); guest agent on and balloon device kept, so Proxmox shows the real RAM (why)
URLhttps://awx.isc3.isc-vs.ch/ (Traefik ingress, certificate awx-tls issued by FreeIPA and renewed by certmonger, October 2026)
InstallAWX Operator 2.19.1 (kustomize, github.com/ansible/awx-operator/releases/tag/2.19.1) on a single-node k3s, run as root in /root/awx/
VersionAWX 24.6.1 (last upstream release, 2024-07-02 — releases are paused), Operator 2.19.1
Stackk3s v1.36.4+k3s1 (containerd, Traefik ingress, local-path storage) + AWX Operator + PostgreSQL 15 (pod)
DatabasePostgreSQL 15 in the pod awx-postgres-15-0, PVC postgres-15-awx-postgres-15-0 (20Gi, local-path) — no external DB

Layout​

Files in /root/awx/:

FilePurpose
kustomization.yamlOperator version, kube-rbac-proxy image redirect, namespace awx, references awx.yaml
awx.yamlThe AWX custom resource (instance awx): ingress, hostname, PostgreSQL storage

kustomization.yaml:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- github.com/ansible/awx-operator/config/default?ref=2.19.1
- awx.yaml
images:
- name: quay.io/ansible/awx-operator
newTag: 2.19.1
- name: gcr.io/kubebuilder/kube-rbac-proxy
newName: quay.io/brancz/kube-rbac-proxy
newTag: v0.15.0
namespace: awx

Workloads in namespace awx:

WorkloadRoleExposed
awx-operator-controller-managerOperator, reconciles the AWX resource (2 containers: awx-manager, kube-rbac-proxy)no
awx-webWeb UI and API (nginx, uwsgi, redis)via Traefik Ingress
awx-taskTask engine, receptor, execution environmentno
awx-postgres-15-0PostgreSQL 15 (StatefulSet)no
awx-migration-24.6.1-*One-shot database migration job (Completed)no

k3s runs as the systemd unit k3s.service; kubeconfig is /etc/rancher/k3s/k3s.yaml, installed with --write-kubeconfig-mode 644 and exported for root in ~/.bashrc (KUBECONFIG=/etc/rancher/k3s/k3s.yaml). The file is readable by every local user: keep shell access to this guest restricted.

Configuration​

/root/awx/awx.yaml (October 2026; applied alone with kubectl apply -n awx -f awx.yaml, the kustomization is only needed to change the operator):

apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx
spec:
service_type: ClusterIP
ingress_type: ingress
ingress_class_name: traefik
ingress_hosts:
- hostname: awx.isc3.isc-vs.ch
- hostname: srv-auto.isc3.isc-vs.ch
tls_secret: awx-tls
ingress_annotations: |
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
postgres_storage_requirements:
requests:
storage: 20Gi

HTTPS only: the ingress is bound to Traefik's websecure entrypoint, plain HTTP answers 404. The awx-tls secret holds a FreeIPA certificate for awx.isc3.isc-vs.ch / srv-auto.isc3.isc-vs.ch, tracked by certmonger (getcert list -i awx-tls) whose post-save command /usr/local/sbin/update-awx-tls refreshes the secret.

caution
A changed AWX resource fails on the finished migration job

The operator re-applies awx-migration-<version> at every reconciliation; once its template changes, Kubernetes refuses to modify a completed Job and the resource reports Failure (Job.batch … is invalid: spec.template). Check that no AWX job is running, then kubectl delete job awx-migration-24.6.1 -n awx: the operator recreates it and the schema migration runs again as a no-op (seconds, no pod restart; done 2026-10-16).

Job pods and TLS trust​

Jobs run as pods of the container group default (quay.io/ansible/awx-ee:latest). That image does not trust the FreeIPA CA, so every pod mounts the host's trust store read-only: /etc/pki/ca-trust/extracted of srv-auto, a FreeIPA client where the IPA.ISC-VS.CH CA is anchored (ipa.p11-kit, kept current by ipa-certupdate) next to the public CAs and Katello's. No playbook ships a CA (October 2026).

The pod spec is awx/container-group-default.yml in dc-isc-prod, pasted into Instance groups → default → Customize pod specification. It lives in the AWX database: check it after an AWX or operator upgrade. The mount is a hostPath, valid while k3s has one node — a second node must be a FreeIPA client too.

Relationship to Windmill orchestration​

AWX is the ISC Ansible execution engine. Playbook source belongs in ISC-HEI/dc-isc-prod/playbooks/, and the AWX Project synchronizes its configured Git branch/revision. AWX owns inventories, credentials, Job Templates (including surveys and RBAC), job execution and its logs. A playbook checked into Git is not automatically an AWX Job Template: configure and authorize that separately.

Windmill on srv-wd is the shared orchestration layer: it presents validated inputs, invokes one or several AWX templates via the REST API, tracks completion and artifacts, and coordinates approvals, cross-system actions, notifications and schedules. Avoid copying Ansible playbooks into Windmill or duplicating the same orchestration logic in both products.

Two legitimate workflow levels: AWX has Workflow Job Templates for stable Ansible-only dependencies (the API test on 2026-11-03 showed Default Configuration, ID 14). Windmill can call an AWX Workflow Job Template as one step. Windmill flows are preferred for multi-application business logic and human gates. Choose one owner per sequence, not two competing implementations.

Operational boundary: the two services are tightly integrated for normal infrastructure operations, but must not have circular boot/recovery dependencies. Authorized administrators can still launch and diagnose an AWX Job Template directly during a Windmill incident. Windmill must fail and alert appropriately when AWX is unreachable.

Access: the Windmill infrastructure client uses the scoped AWX service user svc-windmill-awx-c0; its token is in the Windmill secret variable f/awx-secrets/awx_token (since 2026-11-06, before in a personal u/adrienreynard/ path). Secret-rotation flows have their own separate AWX account, svc-windmill-secrets-c0. The existing srv-bao expiry agent rotates both tokens in Windmill; see the retained secret-sync decision. Read visibility is not equivalent to permission to launch a job.

The target Windmill paths, top-level folder permissions, Git ownership, names, schedules and safe migration from personal spaces are described once in the Windmill target architecture. The work is tracked as HIGH in the ops TODO; no AWX or Windmill production objects were changed when documenting this decision.

Who logs in​

People log in through LDAPS with their FreeIPA -m1 account. The local admin account is the break-glass and the only local login kept: the local adrien.reynard superuser was disabled 2026-10-16 (open item: delete it, ops todo). Superusers in October 2026: admin, yacine.said-m1, adrien.reynard-m1.

edu-ID account linking​

Templates edu-ID - Preflight (Check) and edu-ID - Migration (Run) run dc-isc-prod playbooks/identity/eduid_link.yml. Input: the email; the Migration also asks for the Preflight code (8 characters printed at the end of the Preflight). Since 2026-11-06 the Preflight is mandatory: without the code, or when anything changed since the Preflight (a device added, a role changed…), the Migration stops at PREFLIGHT_REQUIS before any write. The plan also shows the person's NetBird case (simple, or protégé in two phases for a NetBird admin or a device exempt from session expiry, see Keycloak). Secrets come from OpenBao (ansible/keycloak/awx-identity-*, ldap-freeipa-c0/); only AWX superusers can launch them. The Keycloak admin API is reached through a Caddy route reserved to this guest's address (Keycloak). Operating guide, stop messages and security notes: playbooks/identity/README.md in dc-isc-prod.

What the Migration does not do, by hand afterwards when needed:

  • SSH with edu-ID: ipa user-mod <login> --user-auth-type=idp --idp=keycloak-isc --idp-user-id=<email>, ipa user-enable <login>, plus an HBAC rule for the host.
  • Any application access (GLPI group, sudo…): see the application's page, e.g. GLPI.
  • The VPN: the person reconnects each device with the NetBird client, then a new Preflight must say « Recette VPN : OK ».

Common Preflight stops:

  • UID_ROLE — no legacy number and neither staff nor students in Keycloak: add the person's line to provisioning/keycloak/roster.csv, push, run roster-sync.sh --only <email> on srv-keycloak, run the Preflight again.
  • « aucun compte Keycloak lié à edu-ID » — the person never logged in with edu-ID: they connect once with the NetBird client (edu-ID login), then run the Preflight again.

JT 27 FreeIPA - Home directories (mkhomedir) creates FreeIPA homes on hosts enrolled before --mkhomedir (homes).

Mail​

Notifications go out through the rack's outbound relay rather than a direct credential.

Requires this guest's address, 192.168.88.38, to be present in mynetworks on srv-mail (provisioning/mail/deploy-relay.sh). Until it is in the script, a manual postconf -e addition is overwritten by the next run of deploy-relay.sh. Without it, mail is refused at Client host rejected (layer 1, see Email).

Operations​

  • Status:
    kubectl get nodes
    kubectl get pods -n awx
    kubectl get awx,ingress -n awx
    kubectl top nodes
    Expected: all pods Running (migration job Completed), operator 2/2 with a stable RESTARTS count, and kubectl get apiservice v1beta1.metrics.k8s.io showing True.
  • Logs:
    kubectl logs -n awx deploy/awx-operator-controller-manager -c awx-manager --tail 40
    kubectl logs -n awx deploy/awx-web -c awx-web --tail 40
    kubectl logs -n awx deploy/awx-task -c awx-task --tail 40
  • Restart the Operator (forces a new reconciliation):
    kubectl rollout restart deployment awx-operator-controller-manager -n awx
  • Firewall: firewalld is active. Zone trusted holds the k3s networks 10.42.0.0/16 (pods) and 10.43.0.0/16 (services); zone public allows http, https, ssh, cockpit, dhcpv6-client. The Kubernetes API (6443/tcp) is not opened: kubectl is used locally only.
    firewall-cmd --zone=trusted --list-all
    firewall-cmd --list-all
  • SELinux: enforcing; the k3s-selinux package is installed by the k3s installer.
  • Upgrade: no upstream release is expected. If a new AWX Operator tag appears, change ref= and newTag together in kustomization.yaml, take an AWXBackup and a Proxmox snapshot, then kubectl apply -k ..