2018-10-03 22:09:33 +08:00
|
|
|
---
|
2022-04-21 16:06:56 +08:00
|
|
|
- name: dashboard related tasks
|
|
|
|
when: ceph_dashboard_call_item is defined
|
|
|
|
block:
|
|
|
|
- name: set current radosgw_address_block, radosgw_address, radosgw_interface from node "{{ ceph_dashboard_call_item }}"
|
|
|
|
set_fact:
|
|
|
|
radosgw_address_block: "{{ hostvars[ceph_dashboard_call_item]['radosgw_address_block'] | default(radosgw_address_block) }}"
|
|
|
|
radosgw_address: "{{ hostvars[ceph_dashboard_call_item]['radosgw_address'] | default(radosgw_address) }}"
|
|
|
|
radosgw_interface: "{{ hostvars[ceph_dashboard_call_item]['radosgw_interface'] | default(radosgw_interface) }}"
|
|
|
|
|
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:
|
2021-03-03 22:43:50 +08:00
|
|
|
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_facts']['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:
|
2022-05-13 02:49:04 +08:00
|
|
|
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['radosgw_address_block'].split(',')) | last | ansible.utils.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:
|
2022-05-13 02:49:04 +08:00
|
|
|
_radosgw_address: "{{ radosgw_address | ansible.utils.ipwrap }}"
|
2018-10-03 22:09:33 +08:00
|
|
|
when:
|
|
|
|
- radosgw_address is defined
|
2019-12-10 01:23:15 +08:00
|
|
|
- radosgw_address != 'x.x.x.x'
|
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'
|
2019-12-10 01:23:15 +08:00
|
|
|
- radosgw_address == 'x.x.x.x'
|
2019-03-28 16:13:30 +08:00
|
|
|
- radosgw_interface != 'interface'
|
|
|
|
block:
|
2020-03-09 18:05:01 +08:00
|
|
|
- name: set_fact _interface
|
|
|
|
set_fact:
|
2022-06-16 22:53:14 +08:00
|
|
|
_interface: "{{ (hostvars[item]['radosgw_interface'] | replace('-', '_')) }}"
|
|
|
|
loop: "{{ groups.get(rgw_group_name, []) }}"
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: true
|
|
|
|
run_once: true
|
2018-10-03 22:09:33 +08:00
|
|
|
|
2020-03-09 18:05:01 +08:00
|
|
|
- name: set_fact _radosgw_address to radosgw_interface - ipv4
|
|
|
|
set_fact:
|
2022-06-16 22:53:14 +08:00
|
|
|
_radosgw_address: "{{ hostvars[item]['ansible_facts'][hostvars[item]['_interface']][ip_version]['address'] }}"
|
|
|
|
loop: "{{ groups.get(rgw_group_name, []) }}"
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: true
|
2023-09-05 18:32:53 +08:00
|
|
|
run_once: true
|
2020-03-09 18:05:01 +08:00
|
|
|
when: ip_version == 'ipv4'
|
2018-10-03 22:09:33 +08:00
|
|
|
|
2020-03-09 18:05:01 +08:00
|
|
|
- name: set_fact _radosgw_address to radosgw_interface - ipv6
|
|
|
|
set_fact:
|
2022-07-06 09:01:14 +08:00
|
|
|
_radosgw_address: "{{ hostvars[item]['ansible_facts'][hostvars[item]['_interface']][ip_version][0]['address'] | ansible.utils.ipwrap }}"
|
2022-06-16 22:53:14 +08:00
|
|
|
loop: "{{ groups.get(rgw_group_name, []) }}"
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: true
|
2023-09-05 18:32:53 +08:00
|
|
|
run_once: true
|
2020-03-09 18:05:01 +08:00
|
|
|
when: ip_version == 'ipv6'
|
2020-01-31 23:42:10 +08:00
|
|
|
|
2024-02-14 17:36:19 +08:00
|
|
|
- name: rgw_instances
|
2019-10-05 03:31:25 +08:00
|
|
|
when:
|
2022-04-13 16:42:47 +08:00
|
|
|
- ceph_dashboard_call_item is defined or
|
|
|
|
inventory_hostname in groups.get(rgw_group_name, [])
|
2023-09-05 18:39:15 +08:00
|
|
|
block:
|
|
|
|
- name: reset rgw_instances (workaround)
|
|
|
|
set_fact:
|
|
|
|
rgw_instances: []
|
|
|
|
|
2024-02-14 17:36:19 +08:00
|
|
|
- name: set_fact rgw_instances
|
2023-09-05 18:39:15 +08:00
|
|
|
set_fact:
|
|
|
|
rgw_instances: "{{ rgw_instances|default([]) | union([{'instance_name': 'rgw' + item|string, 'radosgw_address': hostvars[ceph_dashboard_call_item | default(inventory_hostname)]['_radosgw_address'], 'radosgw_frontend_port': radosgw_frontend_port|int + item|int }]) }}"
|
|
|
|
with_sequence: start=0 end={{ radosgw_num_instances|int - 1 }}
|
|
|
|
delegate_to: "{{ ceph_dashboard_call_item if ceph_dashboard_call_item is defined else inventory_hostname }}"
|
|
|
|
delegate_facts: "{{ true if ceph_dashboard_call_item is defined else false }}"
|