AWX Cluster ID different than Hostname in Docker

We are trying to get the AWX stuff working in swarm without hardcoding the hostnames of the task container to “awx” – this means that on every reboot that the hostname of the task and web containers will be random.

We did some digging on CLUSTER_HOST_ID and it doesnt look like this setting grabs from the environment, it’s always hardcoded to “awx” in settings.py. This causes an issue when the hostname is not “awx”. To further the issue, it looks like “launch_awx_task.sh” assumes that the cluster host id is the hostname, “awx-manage provision_instance --hostname=$(hostname)”. So it looks like the lowest impact solution is to set the CLUSTER_HOST_ID to the hostname of the container.

It looks like this means we need to change settings.py on the task container so that CLUSTER_HOST_ID is set to the hostname. It also looks like we will want to set “AWX_AUTO_DEPROVISION_INSTANCES” to true so that old task containers get deprovisioned.

Finally, it also looks like on the web container that we might have to set “AWX_AUTO_DEPROVISION_INSTANCES” to true so that it auto provisions the web container an instance on first run (otherwise we get cellery errors that the instance (the hostname of awxweb) does not exist).

However, this causes the web container to appear as its own instance in AWX – is this a problem?

We don’t officially support docker swarm so you’re on your own a bit here.