mirror of https://github.com/ceph/ceph-ansible.git
rgw: add ceph-validate tasks for multisite, other fixes
- updated README-MULTISITE - re-added destroy.yml - added tasks in ceph-validate to make sure the rgw multisite vars are set Signed-off-by: Ali Maredia <amaredia@redhat.com>pull/3217/head
parent
77d5d128c3
commit
59e6d04f9b
|
@ -33,6 +33,7 @@ rgw_multisite: true
|
|||
rgw_zone: jupiter
|
||||
rgw_zonemaster: true
|
||||
rgw_zonesecondary: false
|
||||
rgw_multisite_endpoint_addr: "{{ ansible_fqdn }}"
|
||||
rgw_zonegroup: solarsystem
|
||||
rgw_zone_user: zone.user
|
||||
rgw_realm: milkyway
|
||||
|
@ -56,6 +57,7 @@ rgw_multisite: true
|
|||
rgw_zone: mars
|
||||
rgw_zonemaster: false
|
||||
rgw_zonesecondary: true
|
||||
rgw_multisite_endpoint_addr: "{{ ansible_fqdn }}"
|
||||
rgw_zonegroup: solarsystem
|
||||
rgw_zone_user: zone.user
|
||||
rgw_realm: milkyway
|
||||
|
@ -66,7 +68,7 @@ rgw_pull_port: 8080
|
|||
rgw_pullhost: cluster0-rgw0
|
||||
```
|
||||
|
||||
**Note:** pullhost should be the host of the RGW that is configured as the Zone Master
|
||||
**Note:** pullhost should be the rgw_multisite_endpoint_addr of the RGW that is configured as the Zone Master
|
||||
**Note:** rgw_zone_user, system_access_key, and system_secret_key should match what you used in the master cluster
|
||||
**Note:** rgw_zonemaster should have the value of false and rgw_zonesecondary should be true
|
||||
|
||||
|
|
|
@ -63,16 +63,16 @@ dummy:
|
|||
#rgw_zonemaster: true
|
||||
#rgw_zonesecondary: false
|
||||
#rgw_multisite_endpoint_addr: "{{ ansible_fqdn }}"
|
||||
#rgw_zonegroup: dummy # should be set by the user
|
||||
#rgw_zonegroup: solarsystem # should be set by the user
|
||||
#rgw_zone_user: zone.user
|
||||
#rgw_realm: dummy # should be set by the user
|
||||
#system_access_key: 6kWkikvapSnHyE22P7nO
|
||||
#system_secret_key: MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt
|
||||
#rgw_realm: milkyway # should be set by the user
|
||||
#system_access_key: 6kWkikvapSnHyE22P7nO # should be re-created by the user
|
||||
#system_secret_key: MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt # should be re-created by the user
|
||||
|
||||
# Multi-site remote pull URL variables
|
||||
#rgw_pull_port: "{{ radosgw_civetweb_port }}"
|
||||
#rgw_pull_proto: "http"
|
||||
#rgw_pullhost: localhost # rgw_pullhost only needs to be declared if there is a zone secondary
|
||||
#rgw_pullhost: localhost # rgw_pullhost only needs to be declared if there is a zone secondary. It should be the same as rgw_multisite_endpoint_addr for the master cluster
|
||||
|
||||
##########
|
||||
# DOCKER #
|
||||
|
|
|
@ -55,16 +55,16 @@ rgw_zone: default
|
|||
rgw_zonemaster: true
|
||||
rgw_zonesecondary: false
|
||||
rgw_multisite_endpoint_addr: "{{ ansible_fqdn }}"
|
||||
#rgw_zonegroup: dummy # should be set by the user
|
||||
#rgw_zonegroup: solarsystem # should be set by the user
|
||||
#rgw_zone_user: zone.user
|
||||
#rgw_realm: dummy # should be set by the user
|
||||
#system_access_key: 6kWkikvapSnHyE22P7nO
|
||||
#system_secret_key: MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt
|
||||
#rgw_realm: milkyway # should be set by the user
|
||||
#system_access_key: 6kWkikvapSnHyE22P7nO # should be re-created by the user
|
||||
#system_secret_key: MGecsMrWtKZgngOHZdrd6d3JxGO5CPWgT2lcnpSt # should be re-created by the user
|
||||
|
||||
# Multi-site remote pull URL variables
|
||||
rgw_pull_port: "{{ radosgw_civetweb_port }}"
|
||||
rgw_pull_proto: "http"
|
||||
#rgw_pullhost: localhost # rgw_pullhost only needs to be declared if there is a zone secondary
|
||||
#rgw_pullhost: localhost # rgw_pullhost only needs to be declared if there is a zone secondary. It should be the same as rgw_multisite_endpoint_addr for the master cluster
|
||||
|
||||
##########
|
||||
# DOCKER #
|
||||
|
|
|
@ -16,9 +16,7 @@
|
|||
|
||||
- name: include_tasks multisite/main.yml
|
||||
include_tasks: multisite/main.yml
|
||||
when:
|
||||
- rgw_multisite
|
||||
- ceph_release_num[ceph_release] >= ceph_release_num.jewel
|
||||
when: rgw_multisite
|
||||
|
||||
- name: include_tasks docker/main.yml
|
||||
include_tasks: docker/main.yml
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
- name: delete the zone user
|
||||
command: radosgw-admin user rm --uid=zone.user
|
||||
run_once: true
|
||||
failed_when: false
|
||||
|
||||
- name: remove zone from zonegroup
|
||||
command: radosgw-admin zonegroup remove --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }}
|
||||
run_once: true
|
||||
failed_when: false
|
||||
notify:
|
||||
- update period
|
||||
|
||||
- name: delete the zone
|
||||
command: radosgw-admin zone delete --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }}
|
||||
run_once: true
|
||||
failed_when: false
|
||||
|
||||
- name: delete the zonegroup
|
||||
command: radosgw-admin zonegroup delete --rgw-zonegroup={{ rgw_zonegroup }}
|
||||
run_once: true
|
||||
failed_when: false
|
||||
|
||||
- name: delete the realm
|
||||
command: radosgw-admin realm delete --rgw-realm={{ rgw_realm }}
|
||||
run_once: true
|
||||
failed_when: false
|
||||
|
||||
- name: delete zone from rgw stanza in ceph.conf
|
||||
lineinfile:
|
||||
dest: "/etc/ceph/{{ cluster }}.conf"
|
||||
regexp: "rgw_zone = {{ rgw_zonegroup }}-{{ rgw_zone }}"
|
||||
state: absent
|
||||
when:
|
||||
- rgw_zone is defined
|
||||
- rgw_zonegroup is defined
|
||||
notify:
|
||||
- restart rgw
|
|
@ -0,0 +1,68 @@
|
|||
---
|
||||
- name: fail if rgw_zone is default
|
||||
fail:
|
||||
msg: "rgw_zone cannot be named 'default'"
|
||||
when: rgw_zone == 'default' or rgw_zone is undefined
|
||||
|
||||
- name: fail if either rgw_zonemaster or rgw_zonesecondary is undefined
|
||||
fail:
|
||||
msg: "rgw_zonemaster and rgw_zonesecondary must be defined"
|
||||
when: rgw_zonemaster is undefined or rgw_zonesecondary is undefined
|
||||
|
||||
- name: fail if rgw_zonemaster and rgw_zonesecondary are both true
|
||||
fail:
|
||||
msg: "rgw_zonemaster and rgw_zonesecondary cannot both be true"
|
||||
when:
|
||||
- rgw_zonemaster
|
||||
- rgw_zonesecondary
|
||||
|
||||
- name: fail if rgw_zonegroup is not set
|
||||
fail:
|
||||
msg: "rgw_zonegroup has not been set by the user"
|
||||
when: rgw_zonegroup is undefined
|
||||
|
||||
- name: fail if rgw_zone_user is not set
|
||||
fail:
|
||||
msg: "rgw_zone_user has not been set by the user"
|
||||
when: rgw_zone_user is undefined
|
||||
|
||||
- name: fail if rgw_realm is not set
|
||||
fail:
|
||||
msg: "rgw_realm has not been set by the user"
|
||||
when: rgw_realm is undefined
|
||||
|
||||
- name: fail if system_access_key is not set
|
||||
fail:
|
||||
msg: "system_access_key has not been set by the user"
|
||||
when: system_access_key is undefined
|
||||
|
||||
- name: fail if system_secret_key is not set
|
||||
fail:
|
||||
msg: "system_secret_key has not been set by the user"
|
||||
when: system_secret_key is undefined
|
||||
|
||||
- name: fail if rgw_multisite_endpoint_addr is not set
|
||||
fail:
|
||||
msg: "rgw_multisite_endpoint_addr has not been set by the user"
|
||||
when: rgw_multisite_endpoint_addr is undefined
|
||||
|
||||
- name: fail if rgw_pull_port is not set
|
||||
fail:
|
||||
msg: "rgw_pull_port has not been set by the user"
|
||||
when:
|
||||
- rgw_zonesecondary
|
||||
- rgw_pull_port is undefined
|
||||
|
||||
- name: fail if rgw_pull_proto is not set
|
||||
fail:
|
||||
msg: "rgw_pull_proto has not been set by the user"
|
||||
when:
|
||||
- rgw_zonesecondary
|
||||
- rgw_pull_proto is undefined
|
||||
|
||||
- name: fail if rgw_pullhost is not set
|
||||
fail:
|
||||
msg: "rgw_pullhost has not been set by the user"
|
||||
when:
|
||||
- rgw_zonesecondary
|
||||
- rgw_pullhost is undefined
|
|
@ -69,6 +69,12 @@
|
|||
- radosgw_address == "0.0.0.0"
|
||||
- radosgw_address_block == "subnet"
|
||||
|
||||
- name: include check_rgw_multisite.yml
|
||||
include_tasks: check_rgw_multisite.yml
|
||||
when:
|
||||
- inventory_hostname in groups.get(rgw_group_name, [])
|
||||
- rgw_multisite
|
||||
|
||||
- name: include check_iscsi.yml
|
||||
include_tasks: check_iscsi.yml
|
||||
when:
|
||||
|
|
Loading…
Reference in New Issue