2018-10-03 22:09:33 +08:00
|
|
|
---
|
2019-04-06 03:04:45 +08:00
|
|
|
- name: set_fact _radosgw_address to radosgw_address_block ipv4
|
2018-10-03 22:09:33 +08:00
|
|
|
set_fact:
|
2019-10-03 20:13:01 +08:00
|
|
|
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_all_ipv4_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['radosgw_address_block'].split(',')) | first }}"
|
2018-10-03 22:09:33 +08:00
|
|
|
when:
|
|
|
|
- radosgw_address_block is defined
|
|
|
|
- radosgw_address_block != 'subnet'
|
2019-04-06 03:04:45 +08:00
|
|
|
- ip_version == 'ipv4'
|
|
|
|
|
|
|
|
- name: set_fact _radosgw_address to radosgw_address_block ipv6
|
|
|
|
set_fact:
|
2019-10-03 20:13:01 +08:00
|
|
|
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_all_ipv6_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['radosgw_address_block'].split(',')) | last | ipwrap }}"
|
2019-04-06 03:04:45 +08:00
|
|
|
when:
|
|
|
|
- radosgw_address_block is defined
|
|
|
|
- radosgw_address_block != 'subnet'
|
|
|
|
- ip_version == 'ipv6'
|
2018-10-03 22:09:33 +08:00
|
|
|
|
|
|
|
- name: set_fact _radosgw_address to radosgw_address
|
|
|
|
set_fact:
|
|
|
|
_radosgw_address: "{{ radosgw_address | ipwrap }}"
|
|
|
|
when:
|
|
|
|
- radosgw_address is defined
|
2018-11-29 03:53:10 +08:00
|
|
|
- radosgw_address != '0.0.0.0'
|
2018-10-03 22:09:33 +08:00
|
|
|
|
2019-03-28 16:13:30 +08:00
|
|
|
- name: tasks for radosgw interface
|
|
|
|
when:
|
|
|
|
- radosgw_address_block == 'subnet'
|
|
|
|
- radosgw_address == '0.0.0.0'
|
|
|
|
- radosgw_interface != 'interface'
|
|
|
|
block:
|
2018-10-03 22:09:33 +08:00
|
|
|
- name: set_fact _interface
|
|
|
|
set_fact:
|
|
|
|
_interface: "{{ 'ansible_' + (radosgw_interface | replace('-', '_')) }}"
|
|
|
|
|
|
|
|
- name: set_fact _radosgw_address to radosgw_interface - ipv4
|
|
|
|
set_fact:
|
|
|
|
_radosgw_address: "{{ hostvars[inventory_hostname][_interface][ip_version]['address'] }}"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ip_version == 'ipv4'
|
2018-10-03 22:09:33 +08:00
|
|
|
|
|
|
|
- name: set_fact _radosgw_address to radosgw_interface - ipv6
|
|
|
|
set_fact:
|
|
|
|
_radosgw_address: "{{ hostvars[inventory_hostname][_interface][ip_version][0]['address'] }}"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ip_version == 'ipv6'
|