|  | --- | 
|  | - name: Normalized name for ldap ip if on dc-1 | 
|  | cache: | 
|  | key: 'ldap_ip' | 
|  | value: "{{ hostvars[groups['dc-1-ms'][0]][interface_name].ipv4.address }}" | 
|  | when: groups['dc-1'] is defined and groups['dc-1-ms'] is defined and groups['dc-1-ldap'] is not defined and inventory_hostname in groups['dc-1'] and hostvars[groups['dc-1-ms'][0]][interface_name].ipv4.address is defined | 
|  |  | 
|  | - name: Clear ldap type | 
|  | cache: | 
|  | key: opdk_ldap_type | 
|  | value: '1' | 
|  |  | 
|  | - block: | 
|  | - name: Normalized name for ldap ip when ldap is a declared if on dc-1 | 
|  | cache: | 
|  | key: 'ldap_ip' | 
|  | value: "{{ hostvars[groups['dc-1-ldap'][0]][interface_name].ipv4.address }}" | 
|  |  | 
|  | - name: Set ldap remote flag | 
|  | cache: | 
|  | key: use_opdk_ldap_remote_host | 
|  | value: 'y' | 
|  | when: ldap_ip != local_mgmt_ip | 
|  |  | 
|  | - name: Set ldap port | 
|  | cache: | 
|  | key: opdk_ldap_port | 
|  | value: '{{ ldap_data_port }}' | 
|  |  | 
|  | - name: Set ldap type | 
|  | cache: | 
|  | key: opdk_ldap_type | 
|  | value: 2 | 
|  | when: groups['dc-2-ldap'] is defined | 
|  |  | 
|  | - name: Set ldap sid flag | 
|  | cache: | 
|  | key: ldap_sid | 
|  | value: 1 | 
|  |  | 
|  | when: groups['dc-1'] is defined and groups['dc-1-ldap'] is defined and inventory_hostname in groups['dc-1'] and hostvars[groups['dc-1-ms'][0]][interface_name].ipv4.address is defined | 
|  |  | 
|  | - name: Normalized name for ldap ip if on dc-2 | 
|  | cache: | 
|  | key: 'ldap_ip' | 
|  | value: "{{ hostvars[groups['dc-2-ms'][0]][interface_name].ipv4.address }}" | 
|  | when: groups['dc-2'] is defined and groups['dc-2-ms'] is defined and groups['dc-2-ldap'] is not defined and inventory_hostname in groups['dc-2'] and hostvars[groups['dc-2-ms'][0]][interface_name].ipv4.address is defined | 
|  |  | 
|  | - block: | 
|  | - name: Normalized name for ldap ip is declared if on dc-2 | 
|  | cache: | 
|  | key: 'ldap_ip' | 
|  | value: "{{ hostvars[groups['dc-2-ldap'][0]][interface_name].ipv4.address }}" | 
|  |  | 
|  | - name: Set ldap remote flag | 
|  | cache: | 
|  | key: use_opdk_ldap_remote_host | 
|  | value: 'y' | 
|  | when: ldap_ip != local_mgmt_ip | 
|  |  | 
|  | - name: Set ldap port | 
|  | cache: | 
|  | key: opdk_ldap_port | 
|  | value: '{{ ldap_data_port }}' | 
|  |  | 
|  | - name: Set ldap type | 
|  | cache: | 
|  | key: opdk_ldap_type | 
|  | value: 2 | 
|  | when: groups['dc-1-ldap'] is defined | 
|  |  | 
|  | - name: Set ldap sid flag | 
|  | cache: | 
|  | key: ldap_sid | 
|  | value: 2 | 
|  |  | 
|  | when: groups['dc-2'] is defined and groups['dc-2-ldap'] is defined and inventory_hostname in groups['dc-2'] and hostvars[groups['dc-1-ms'][0]][interface_name].ipv4.address is defined | 
|  |  | 
|  | - name: Normalized name for management server local ip to dc-1 if current node is not on dc-1 or dc-2 | 
|  | cache: | 
|  | key: 'ldap_ip' | 
|  | value: "{{ local_mgmt_ip }}" | 
|  | when: ldap_ip is not defined or ldap_ip | trim | length == 0 |