|
31 | 31 | - name: set_fact _interface
|
32 | 32 | set_fact:
|
33 | 33 | _interface: "{{ (radosgw_interface | replace('-', '_')) }}"
|
| 34 | + loop: "{{ groups.get(rgw_group_name, []) }}" |
| 35 | + delegate_to: "{{ item }}" |
34 | 36 |
|
35 | 37 | - name: set_fact _radosgw_address to radosgw_interface - ipv4
|
36 | 38 | set_fact:
|
37 |
| - _radosgw_address: "{{ hostvars[inventory_hostname]['ansible_facts'][_interface][ip_version]['address'] }}" |
| 39 | + _radosgw_address: "{{ hostvars[item]['ansible_facts'][_interface][ip_version]['address'] }}" |
| 40 | + loop: "{{ groups.get(rgw_group_name, []) }}" |
| 41 | + delegate_to: "{{ item }}" |
| 42 | + delegate_facts: true |
38 | 43 | when: ip_version == 'ipv4'
|
39 | 44 |
|
40 | 45 | - name: set_fact _radosgw_address to radosgw_interface - ipv6
|
41 | 46 | set_fact:
|
42 |
| - _radosgw_address: "{{ hostvars[inventory_hostname]['ansible_facts'][_interface][ip_version][0]['address'] | ipwrap }}" |
| 47 | + _radosgw_address: "{{ hostvars[item]['ansible_facts'][_interface][ip_version][0]['address'] | ipwrap }}" |
| 48 | + loop: "{{ groups.get(rgw_group_name, []) }}" |
| 49 | + delegate_to: "{{ item }}" |
| 50 | + delegate_facts: true |
43 | 51 | when: ip_version == 'ipv6'
|
44 | 52 |
|
45 | 53 | - name: set_fact rgw_instances without rgw multisite
|
46 | 54 | set_fact:
|
47 |
| - rgw_instances: "{{ rgw_instances|default([]) | union([{'instance_name': 'rgw' + item|string, 'radosgw_address': _radosgw_address, 'radosgw_frontend_port': radosgw_frontend_port|int + item|int }]) }}" |
| 55 | + 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 }]) }}" |
48 | 56 | with_sequence: start=0 end={{ radosgw_num_instances|int - 1 }}
|
| 57 | + delegate_to: "{{ ceph_dashboard_call_item if ceph_dashboard_call_item is defined else inventory_hostname }}" |
| 58 | + delegate_facts: "{{ true if ceph_dashboard_call_item is defined else false }}" |
49 | 59 | when:
|
50 |
| - - inventory_hostname in groups.get(rgw_group_name, []) |
| 60 | + - ceph_dashboard_call_item is defined or |
| 61 | + inventory_hostname in groups.get(rgw_group_name, []) |
51 | 62 | - not rgw_multisite | bool
|
52 | 63 |
|
53 | 64 | - name: set_fact is_rgw_instances_defined
|
|
59 | 70 |
|
60 | 71 | - name: set_fact rgw_instances with rgw multisite
|
61 | 72 | set_fact:
|
62 |
| - rgw_instances: "{{ rgw_instances|default([]) | union([{ 'instance_name': 'rgw' + item | string, 'radosgw_address': _radosgw_address, 'radosgw_frontend_port': radosgw_frontend_port | int + item|int, 'rgw_realm': rgw_realm | string, 'rgw_zonegroup': rgw_zonegroup | string, 'rgw_zone': rgw_zone | string, 'system_access_key': system_access_key, 'system_secret_key': system_secret_key, 'rgw_zone_user': rgw_zone_user, 'rgw_zone_user_display_name': rgw_zone_user_display_name, 'endpoint': (rgw_pull_proto + '://' + rgw_pullhost + ':' + rgw_pull_port | string) if not rgw_zonemaster | bool and rgw_zonesecondary | bool else omit }]) }}" |
| 73 | + 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, 'rgw_realm': rgw_realm | string, 'rgw_zonegroup': rgw_zonegroup | string, 'rgw_zone': rgw_zone | string, 'system_access_key': system_access_key, 'system_secret_key': system_secret_key, 'rgw_zone_user': rgw_zone_user, 'rgw_zone_user_display_name': rgw_zone_user_display_name, 'endpoint': (rgw_pull_proto + '://' + rgw_pullhost + ':' + rgw_pull_port | string) if not rgw_zonemaster | bool and rgw_zonesecondary | bool else omit }]) }}" |
63 | 74 | with_sequence: start=0 end={{ radosgw_num_instances|int - 1 }}
|
| 75 | + delegate_to: "{{ ceph_dashboard_call_item if ceph_dashboard_call_item is defined else inventory_hostname }}" |
| 76 | + delegate_facts: "{{ true if ceph_dashboard_call_item is defined else false }}" |
64 | 77 | when:
|
65 |
| - - inventory_hostname in groups.get(rgw_group_name, []) |
| 78 | + - ceph_dashboard_call_item is defined or |
| 79 | + inventory_hostname in groups.get(rgw_group_name, []) |
66 | 80 | - rgw_multisite | bool
|
67 | 81 | - not is_rgw_instances_defined | default(False) | bool
|
68 | 82 |
|
|
78 | 92 | set_fact:
|
79 | 93 | rgw_instances_all: '{{ rgw_instances_all | default([]) | union(hostvars[item]["rgw_instances_host"]) }}'
|
80 | 94 | with_items: "{{ groups.get(rgw_group_name, []) }}"
|
81 |
| - run_once: true |
82 | 95 | when:
|
83 | 96 | - inventory_hostname in groups.get(rgw_group_name, [])
|
84 | 97 | - hostvars[item]["rgw_instances_host"] is defined
|
|
0 commit comments