updated logic
diff --git a/tasks/main.yml b/tasks/main.yml
index d96e181..e8ebc4c 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -24,6 +24,17 @@
- include: cassandra.yml
+- name: Regional LDAP IP for dc-1 if replicating LDAP
+ set_fact:
+ ldap_peer: "{{ hostvars[groups['dc-2-ldap'][0]]['private_address'] }}"
+ when: region == 'dc-1' and opdk_ldap_type == '2'
+
+- name: Regional LDAP IP for dc-2 if replicating LDAP
+ set_fact:
+ ldap_sid
+ ldap_peer: "{{ hostvars[groups['dc-1-ldap'][0]]['private_address'] }}"
+ when: region == 'dc-2' and opdk_ldap_type == '2'
+
- name: Ensure that a folder exists for the file to be generated
file:
path: "{{ opdk_installation_config_file | dirname }}"
diff --git a/templates/silent-install.conf.j2 b/templates/silent-install.conf.j2
index dc62723..7dc0894 100644
--- a/templates/silent-install.conf.j2
+++ b/templates/silent-install.conf.j2
@@ -9,14 +9,10 @@
LDAP_TYPE='{{ opdk_ldap_type }}'
{% if opdk_ldap_type == '2' %}
{#{% if groups['dc-1-ldap'] is defined and groups['dc-2-ldap'] is defined and inventory_hostname in groups['dc-1-edge'] %}#}
-{% if inventory_hostname in groups['dc-1-edge'] %}
-LDAP_SID=1
-LDAP_PEER={{ hostvars[groups['dc-2-ldap'][0]]['private_address'] }}
-{% endif %}
+LDAP_SID={{ ldap_sid }}
+{#LDAP_PEER={{ hostvars[groups['dc-2-ldap'][0]]['private_address'] }}#}
+LDAP_PEER={{ ldap_peer }}
{#{% if groups['dc-1-ldap'] is defined and groups['dc-2-ldap'] is defined and inventory_hostname in groups['dc-2-edge'] %}#}
-LDAP_SID=2
-LDAP_PEER={{ hostvars[groups['dc-1-ldap'][0]]['private_address'] }}
-{#{% endif %}#}
{% endif %}
APIGEE_LDAPPW='{{ opdk_ldap_pass }}'
{% endif %}