# AWX Cluster ID different than Hostname in Docker

**URL:** <https://forum.ansible.com/t/awx-cluster-id-different-than-hostname-in-docker/27817>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [June 18, 2018, 8:22pm UTC](https://forum.ansible.com/t/awx-cluster-id-different-than-hostname-in-docker/27817 "2018-06-18T20:22:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Hickok](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Matt\_Hickok](https://forum.ansible.com/u/Matt_Hickok)\
**Post date:** [June 18, 2018, 8:22pm UTC](https://forum.ansible.com/t/awx-cluster-id-different-than-hostname-in-docker/27817/1 "2018-06-18T20:22:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [June 21, 2018, 3:48pm UTC](https://forum.ansible.com/t/awx-cluster-id-different-than-hostname-in-docker/27817/2 "2018-06-21T15:48:23Z")

</div>

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