2016-08-11 05:05:27 +08:00
|
|
|
---
|
2021-01-15 00:52:39 +08:00
|
|
|
- name: set_fact realms
|
|
|
|
set_fact:
|
|
|
|
realms: '{{ realms | default([]) | union([item.rgw_realm]) }}'
|
|
|
|
run_once: true
|
|
|
|
loop: "{{ rgw_instances_all }}"
|
|
|
|
when: item.rgw_zonemaster | default(hostvars[item.host]['rgw_zonemaster']) | bool
|
|
|
|
|
|
|
|
- name: create list zonegroups
|
|
|
|
set_fact:
|
|
|
|
zonegroups: "{{ zonegroups | default([]) | union([{ 'realm': item.rgw_realm, 'zonegroup': item.rgw_zonegroup, 'is_master': item.rgw_zonegroupmaster | default(hostvars[item.host]['rgw_zonegroupmaster']) }]) }}"
|
|
|
|
run_once: true
|
|
|
|
loop: "{{ rgw_instances_all }}"
|
2021-02-05 00:45:05 +08:00
|
|
|
when: item.rgw_zonegroupmaster | default(hostvars[item.host]['rgw_zonegroupmaster']) | bool
|
2021-01-15 00:52:39 +08:00
|
|
|
|
|
|
|
- name: create list zones
|
|
|
|
set_fact:
|
|
|
|
zones: "{{ zones | default([]) | union([{ 'realm': item.rgw_realm, 'zonegroup': item.rgw_zonegroup, 'zone': item.rgw_zone, 'is_master': item.rgw_zonemaster | default(hostvars[item.host]['rgw_zonemaster']), 'system_access_key': item.system_access_key, 'system_secret_key': item.system_secret_key }]) }}"
|
|
|
|
run_once: true
|
|
|
|
loop: "{{ rgw_instances_all }}"
|
|
|
|
|
|
|
|
- name: create a list of dicts with each rgw endpoint and it's zone
|
|
|
|
set_fact:
|
|
|
|
zone_endpoint_pairs: "{{ zone_endpoint_pairs | default([]) | union([{ 'endpoint': hostvars[item.host]['rgw_multisite_proto'] + '://' + item.radosgw_address + ':' + item.radosgw_frontend_port | string, 'rgw_zone': item.rgw_zone, 'rgw_realm': item.rgw_realm, 'rgw_zonegroup': item.rgw_zonegroup, 'rgw_zonemaster': item.rgw_zonemaster | default(hostvars[item.host]['rgw_zonemaster']) }]) }}"
|
|
|
|
loop: "{{ rgw_instances_all }}"
|
|
|
|
run_once: true
|
|
|
|
|
|
|
|
- name: create a list of zones and all their endpoints
|
|
|
|
set_fact:
|
|
|
|
zone_endpoints_list: "{{ zone_endpoints_list | default([]) | union([{'zone': item.rgw_zone, 'zonegroup': item.rgw_zonegroup, 'realm': item.rgw_realm, 'is_master': item.rgw_zonemaster, 'endpoints': ','.join(zone_endpoint_pairs | selectattr('rgw_zone','match','^'+item.rgw_zone+'$') | selectattr('rgw_realm','match','^'+item.rgw_realm+'$') | selectattr('rgw_zonegroup', 'match','^'+item.rgw_zonegroup+'$') | map(attribute='endpoint'))}]) }}"
|
|
|
|
loop: "{{ zone_endpoint_pairs }}"
|
|
|
|
run_once: true
|
2019-10-05 03:31:25 +08:00
|
|
|
|
2016-08-11 05:05:27 +08:00
|
|
|
# Include the tasks depending on the zone type
|
2018-08-10 20:16:30 +08:00
|
|
|
- name: include_tasks master.yml
|
|
|
|
include_tasks: master.yml
|
2019-10-05 03:31:25 +08:00
|
|
|
|
2018-08-10 20:16:30 +08:00
|
|
|
- name: include_tasks secondary.yml
|
|
|
|
include_tasks: secondary.yml
|
2021-01-15 00:52:39 +08:00
|
|
|
when: deploy_secondary_zones | default(True) | bool
|
2016-08-11 05:05:27 +08:00
|
|
|
|
2021-01-15 00:52:39 +08:00
|
|
|
- name: include_tasks start_radosgw.yml
|
2019-10-05 03:31:25 +08:00
|
|
|
include_tasks: ../start_radosgw.yml
|
2019-01-23 09:36:25 +08:00
|
|
|
when:
|
2019-10-05 03:31:25 +08:00
|
|
|
- not containerized_deployment | bool
|
|
|
|
|
2021-01-15 00:52:39 +08:00
|
|
|
- name: include_tasks start_docker_rgw.yml
|
2019-10-05 03:31:25 +08:00
|
|
|
include_tasks: ../start_docker_rgw.yml
|
|
|
|
when:
|
|
|
|
- containerized_deployment | bool
|