AWX is originally designed to run in a Kubernetes environment only. This code allows you to install and use AWX only using Docker without K8S. Ideas from awx, awx-operator and awx-ee code.
Main branch is compatible with AWX version 24.6.1. Use git tag with desired version.
This code can also be used as an Ansible collection and installed from Ansible Galaxy:
ansible-galaxy collection install fitbeard.awx
or desired version
ansible-galaxy collection install fitbeard.awx:24.6.1
- Ansible
- Working hostname resolution mechanism
(DNS records, Docker's
extra_hosts
values,/etc/hosts
)
Befor installation please read about AWX in general, AWX node types (control, hybrid, hop, execution), execution nodes and receptor. These are beyond the scope of this guide.
Demo secrets, certs, keys are for test purpose ONLY. Please do not use for production.
This is not necessary as this demo contains all needed secrets. This is an example of how to create secret data for production.
mkdir secrets
cd secrets
openssl genrsa -out awx_mesh_ca_key 4096
openssl req -x509 -new -nodes -key awx_mesh_ca_key -subj "CN=AWX Demo Receptor Root CA" -sha256 -days 3650 -out awx_mesh_ca_crt
openssl req -x509 -newkey rsa:4096 -keyout awx_web_cert_key -out awx_web_cert_crt -sha256 -days 365
openssl rsa -in awx_web_cert_key -out awx_web_cert_key
openssl genrsa -out awx_receptor_signing_private_key 4096
openssl rsa -in awx_receptor_signing_private_key -out awx_receptor_signing_public_key -outform PEM -pubout
Repeat for every node in a cluster
bash ../scripts/receptor_keypair.sh -n awx-1.demo.io
Create custom Docker image
for execution nodes and for management nodes (if awx_node_role_type
variable is set to hybrid
).
Or use quay.io/tadas/awx-without-k8s-ee:latest
image which is based on the same Dockerfile
.
Before actually running playbook, take a look at the role defaults, demo/inventory
and demo/host_vars|group_vars
and make changes accordingly.
cd ../demo
ansible-playbook -i inventory demo.yml --diff
Ansible will do it automatically but in case you need re-add it again.
Repeat for every execution node in cluster
This can be done in Web UI or by using awx-manage
CLI (partially):
docker exec -ti awx-task bash
awx-manage provision_instance --hostname=awx-receptor-1.demo.io --node_type=execution
cd demo
ansible-playbook -i inventory demo.yml --diff -e awx_tasks=upgrade
cd demo
ansible -i inventory all -a "docker rmi awx_img_id"
You'll need to make sure that you have pre-commit
setup and installed in your environment by running these commands:
pre-commit install --hook-type commit-msg