| --- |
| - block: |
| - name: Normalized name for management server public ip on dc-1 |
| cache: |
| key: 'public_mgmt_ip' |
| value: "{{ groups['dc-1-ms'][0] }}" |
| when: groups['dc-1'] is defined and groups['dc-1-ms'] is defined and inventory_hostname in groups['dc-1'] |
| |
| - name: Normalized name for management server public ip on dc-2 |
| cache: |
| key: 'public_mgmt_ip' |
| value: "{{ groups['dc-2-ms'][0] }}" |
| when: groups['dc-2'] is defined and groups['dc-2-ms'] is defined and inventory_hostname in groups['dc-2'] |
| |
| - name: Normalized name for management server public ip to dc-1 if current node is not in dc-1 or dc-2 |
| cache: |
| key: 'public_mgmt_ip' |
| value: "{{ groups['dc-1-ms'][0] }}" |
| when: groups['dc-1'] is defined and groups['dc-1-ms'] is defined and inventory_hostname in groups['dc-1'] |