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