From a290b082db1953acf8b973003ddafbb9c9265ab4 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Thu, 21 Sep 2023 11:31:51 -0400 Subject: [PATCH] Use ldap container hostname for LDAP config (#14473) --- tools/docker-compose/README.md | 6 ++---- .../docker-compose/ansible/templates/ldap_settings.json.j2 | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/docker-compose/README.md b/tools/docker-compose/README.md index a0019685726b..d7babd62047b 100644 --- a/tools/docker-compose/README.md +++ b/tools/docker-compose/README.md @@ -442,13 +442,11 @@ Now we are ready to configure and plumb OpenLDAP with AWX. To do this we have pr Note: The default configuration will utilize the non-tls connection. If you want to use the tls configuration you will need to work through TLS negotiation issues because the LDAP server is using a self signed certificate. -Before we can run the playbook we need to understand that LDAP will be communicated to from within the AWX container. Because of this, we have to tell AWX how to route traffic to the LDAP container through the `LDAP Server URI` settings. The playbook requires a variable called container_reference to be set. The container_reference variable needs to be how your AWX container will be able to talk to the LDAP container. See the SAML section for some examples for how to select a `container_reference`. - -Once you have your container reference you can run the playbook like: +You can run the playbook like: ```bash export CONTROLLER_USERNAME= export CONTROLLER_PASSWORD= -ansible-playbook tools/docker-compose/ansible/plumb_ldap.yml -e container_reference= +ansible-playbook tools/docker-compose/ansible/plumb_ldap.yml ``` diff --git a/tools/docker-compose/ansible/templates/ldap_settings.json.j2 b/tools/docker-compose/ansible/templates/ldap_settings.json.j2 index 8dc07b2c884f..793270d7c93c 100644 --- a/tools/docker-compose/ansible/templates/ldap_settings.json.j2 +++ b/tools/docker-compose/ansible/templates/ldap_settings.json.j2 @@ -1,5 +1,5 @@ { - "AUTH_LDAP_1_SERVER_URI": "ldap://{{ container_reference }}:389", + "AUTH_LDAP_1_SERVER_URI": "ldap://ldap:1389", "AUTH_LDAP_1_BIND_DN": "cn=admin,dc=example,dc=org", "AUTH_LDAP_1_BIND_PASSWORD": "admin", "AUTH_LDAP_1_START_TLS": false,