---
-- name: set_fact _monitor_address to monitor_address_block
+- name: set_fact _monitor_address to monitor_address_block ipv4
set_fact:
- _monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_all_' + ip_version + '_addresses'] | ipaddr(hostvars[item]['monitor_address_block']) | first | ipwrap }] }}"
+ _monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_all_ipv4_addresses'] | ipaddr(hostvars[item]['monitor_address_block']) | first }] }}"
with_items:
- "{{ groups.get(mon_group_name, []) }}"
when:
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
- hostvars[item]['monitor_address_block'] is defined
- hostvars[item]['monitor_address_block'] != 'subnet'
+ - ip_version == 'ipv4'
+
+- name: set_fact _monitor_address to monitor_address_block ipv6
+ set_fact:
+ _monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_all_ipv6_addresses'] | ipaddr(hostvars[item]['monitor_address_block']) | last | ipwrap }] }}"
+ with_items:
+ - "{{ groups.get(mon_group_name, []) }}"
+ when:
+ - "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
+ - hostvars[item]['monitor_address_block'] is defined
+ - hostvars[item]['monitor_address_block'] != 'subnet'
+ - ip_version == 'ipv6'
- name: set_fact _monitor_address to monitor_address
set_fact:
set_fact:
_current_monitor_address: "{{ item.addr }}"
with_items: "{{ _monitor_addresses }}"
- when: inventory_hostname == item.name
\ No newline at end of file
+ when: inventory_hostname == item.name
---
-- name: set_fact _radosgw_address to radosgw_address_block
+- name: set_fact _radosgw_address to radosgw_address_block ipv4
set_fact:
- _radosgw_address: "{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first | ipwrap }}"
+ _radosgw_address: "{{ hostvars[inventory_hostname]['ansible_all_ipv4_addresses'] | ipaddr(radosgw_address_block) | first }}"
when:
- radosgw_address_block is defined
- radosgw_address_block != 'subnet'
+ - ip_version == 'ipv4'
+
+- name: set_fact _radosgw_address to radosgw_address_block ipv6
+ set_fact:
+ _radosgw_address: "{{ hostvars[inventory_hostname]['ansible_all_ipv6_addresses'] | ipaddr(radosgw_address_block) | last | ipwrap }}"
+ when:
+ - radosgw_address_block is defined
+ - radosgw_address_block != 'subnet'
+ - ip_version == 'ipv6'
- name: set_fact _radosgw_address to radosgw_address
set_fact: