-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the possibility to deploy rgw multisite configuration with a mix of secondary and primary zones on a same rgw node. Before that, on a same node, all instances were either primary zones *OR* secondary. Now you can define a rgw instance like following: ``` rgw_instances: - instance_name: 'rgw0' rgw_zonemaster: false rgw_zonesecondary: true rgw_zonegroupmaster: false rgw_realm: 'france' rgw_zonegroup: 'zonegroup-france' rgw_zone: paris-00 radosgw_address: "{{ _radosgw_address }}" radosgw_frontend_port: 8080 rgw_zone_user: jacques.chirac rgw_zone_user_display_name: "Jacques Chirac" system_access_key: P9Eb6S8XNyo4dtZZUUMy system_secret_key: qqHCUtfdNnpHq3PZRHW5un9l0bEBM812Uhow0XfB endpoint: http://192.168.101.12:8080 ``` Basically it's now possible to define `rgw_zonemaster`, `rgw_zonesecondary` and `rgw_zonegroupmaster` at the intsance level instead of the whole node level. Also, this commit adds an option `deploy_secondary_zones` (default True) which can be set to `False` in order to explicitly ask the playbook to not deploy secondary zones in case where the corresponding endpoint are not deployed yet. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1915478 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
- Loading branch information
Showing
34 changed files
with
280 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
roles/ceph-rgw/tasks/multisite/create_realm_zonegroup_zone_lists.yml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,50 @@ | ||
--- | ||
- name: include_tasks create_realm_zonegroup_zone_lists.yml | ||
include_tasks: create_realm_zonegroup_zone_lists.yml | ||
- 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 }}" | ||
when: item.rgw_zonegroupmaster | default(hostvars[item.host]['rgw_zonemaster']) | bool | ||
|
||
- 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 | ||
|
||
# Include the tasks depending on the zone type | ||
- name: include_tasks master.yml | ||
include_tasks: master.yml | ||
when: | ||
- rgw_zonemaster | bool | ||
- not rgw_zonesecondary | bool | ||
|
||
- name: include_tasks start_radosgw.yml for zonemaster rgws | ||
include_tasks: ../start_radosgw.yml | ||
when: | ||
- rgw_zonemaster | bool | ||
- not rgw_zonesecondary | bool | ||
- not containerized_deployment | bool | ||
|
||
- name: include_tasks start_docker_rgw.yml for zonemaster rgws | ||
include_tasks: ../start_docker_rgw.yml | ||
when: | ||
- rgw_zonemaster | bool | ||
- not rgw_zonesecondary | bool | ||
- containerized_deployment | bool | ||
|
||
- name: include_tasks secondary.yml | ||
include_tasks: secondary.yml | ||
when: | ||
- not rgw_zonemaster | bool | ||
- rgw_zonesecondary | bool | ||
when: deploy_secondary_zones | default(True) | bool | ||
|
||
- name: include_tasks start_radosgw.yml for zonesecondary rgws | ||
- name: include_tasks start_radosgw.yml | ||
include_tasks: ../start_radosgw.yml | ||
when: | ||
- not rgw_zonemaster | bool | ||
- rgw_zonesecondary | bool | ||
- not containerized_deployment | bool | ||
|
||
- name: include_tasks start_docker_rgw.yml for zonesecondary rgws | ||
- name: include_tasks start_docker_rgw.yml | ||
include_tasks: ../start_docker_rgw.yml | ||
when: | ||
- not rgw_zonemaster | bool | ||
- rgw_zonesecondary | bool | ||
- containerized_deployment | bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
--- | ||
rgw_instances: | ||
- instance_name: 'rgw0' | ||
rgw_realm: 'france' | ||
rgw_zonegroup: 'idf' | ||
rgw_zone: 'paris' | ||
rgw_zonemaster: True | ||
rgw_zonesecondary: False | ||
rgw_zonegroupmaster: True | ||
rgw_realm: 'canada' | ||
rgw_zonegroup: 'zonegroup-canada' | ||
rgw_zone: montreal-00 | ||
radosgw_address: "{{ _radosgw_address }}" | ||
radosgw_frontend_port: 8080 | ||
rgw_zone_user: jacques.chirac | ||
rgw_zone_user_display_name: "Jacques Chirac" | ||
system_access_key: P9Eb6S8XNyo4dtZZUUMy | ||
system_secret_key: qqHCUtfdNnpHq3PZRHW5un9l0bEBM812Uhow0XfB | ||
- instance_name: 'rgw1' | ||
rgw_realm: 'usa' | ||
rgw_zonegroup: 'alaska' | ||
rgw_zone: 'juneau' | ||
rgw_zonemaster: false | ||
rgw_zonesecondary: true | ||
rgw_zonegroupmaster: false | ||
rgw_realm: 'france' | ||
rgw_zonegroup: 'zonegroup-france' | ||
rgw_zone: montreal-01 | ||
radosgw_address: "{{ _radosgw_address }}" | ||
radosgw_frontend_port: 8081 | ||
rgw_zone_user: edward.lewis | ||
rgw_zone_user_display_name: "Edward Lewis" | ||
system_access_key: yu17wkvAx3B8Wyn08XoF | ||
system_secret_key: 5YZfaSUPqxSNIkZQQA3lBZ495hnIV6k2HAz710BY | ||
endpoint: http://192.168.107.12:8081 | ||
# functional testing | ||
rgw_multisite_endpoint_addr: 192.168.105.11 | ||
radosgw_num_instances: 2 | ||
rgw_multisite_endpoint_addr: 192.168.105.12 | ||
radosgw_num_instances: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
rgw_zonemaster: true | ||
rgw_zonesecondary: false | ||
rgw_zonegroupmaster: true | ||
rgw_multisite_proto: http | ||
rgw_instances: | ||
- instance_name: 'rgw0' | ||
rgw_realm: 'foo' | ||
rgw_zonegroup: 'zonegroup123' | ||
rgw_zone: 'gotham_city' | ||
radosgw_address: "{{ _radosgw_address }}" | ||
radosgw_frontend_port: 8080 | ||
rgw_zone_user: batman | ||
rgw_zone_user_display_name: "Batman" | ||
system_access_key: 9WA1GN33IUYC717S8KB2 | ||
system_secret_key: R2vWXyboYw9nluehMgtATBGDBZSuWLnR0M4xNa1W | ||
- instance_name: 'rgw1' | ||
rgw_realm: 'bar' | ||
rgw_zonegroup: 'zonegroup456' | ||
rgw_zone: 'metropolis' | ||
radosgw_address: "{{ _radosgw_address }}" | ||
radosgw_frontend_port: 8081 | ||
rgw_zone_user: superman | ||
rgw_zone_user_display_name: "Superman" | ||
system_access_key: S96CJL44E29AN91Y3ZC5 | ||
system_secret_key: ha7yWiIi7bSV2vAqMBfKjYIVKMfOBaGkWrUZifRt | ||
# functional testing | ||
rgw_multisite_endpoint_addr: 192.168.105.11 | ||
radosgw_num_instances: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ osd0 | |
|
||
[rgws] | ||
osd0 | ||
rgw0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 16 additions & 10 deletions
26
tests/functional/rgw-multisite/container/secondary/host_vars/osd0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
--- | ||
rgw_instances: | ||
- instance_name: 'rgw0' | ||
rgw_realm: 'france' | ||
rgw_zonegroup: 'idf' | ||
rgw_zone: 'versailles' | ||
rgw_zonemaster: false | ||
rgw_zonesecondary: true | ||
rgw_zonegroupmaster: false | ||
rgw_realm: 'canada' | ||
rgw_zonegroup: 'zonegroup-canada' | ||
rgw_zone: paris-00 | ||
radosgw_address: "{{ _radosgw_address }}" | ||
radosgw_frontend_port: 8080 | ||
rgw_zone_user: jacques.chirac | ||
rgw_zone_user_display_name: "Jacques Chirac" | ||
system_access_key: P9Eb6S8XNyo4dtZZUUMy | ||
system_secret_key: qqHCUtfdNnpHq3PZRHW5un9l0bEBM812Uhow0XfB | ||
endpoint: http://192.168.105.11:8080 | ||
endpoint: http://192.168.105.12:8080 | ||
- instance_name: 'rgw1' | ||
rgw_realm: 'usa' | ||
rgw_zonegroup: 'alaska' | ||
rgw_zone: 'anchorage' | ||
rgw_zonemaster: True | ||
rgw_zonesecondary: False | ||
rgw_zonegroupmaster: True | ||
rgw_realm: 'france' | ||
rgw_zonegroup: 'zonegroup-france' | ||
rgw_zone: paris-01 | ||
radosgw_address: "{{ _radosgw_address }}" | ||
radosgw_frontend_port: 8081 | ||
rgw_zone_user: edward.lewis | ||
rgw_zone_user_display_name: "Edward Lewis" | ||
system_access_key: yu17wkvAx3B8Wyn08XoF | ||
system_secret_key: 5YZfaSUPqxSNIkZQQA3lBZ495hnIV6k2HAz710BY | ||
endpoint: http://192.168.105.11:8081 | ||
# functional testing | ||
rgw_multisite_endpoint_addr: 192.168.107.11 | ||
radosgw_num_instances: 2 | ||
rgw_multisite_endpoint_addr: 192.168.107.12 | ||
radosgw_num_instances: 2 |
Oops, something went wrong.