diff --git a/roles/ceph-rgw/tasks/main.yml b/roles/ceph-rgw/tasks/main.yml index fd6e3108e..ca2f9ea78 100644 --- a/roles/ceph-rgw/tasks/main.yml +++ b/roles/ceph-rgw/tasks/main.yml @@ -14,7 +14,7 @@ # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) static: False -- name: Include rgw multisite playbooks +- name: include rgw multisite playbooks include: multisite/main.yml when: rgw_zone is defined and rgw_multisite and ( is_jewel or is_after_jewel ) # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) diff --git a/roles/ceph-rgw/tasks/multisite/checks.yml b/roles/ceph-rgw/tasks/multisite/checks.yml index 849e1ff33..7bc6bbb8d 100644 --- a/roles/ceph-rgw/tasks/multisite/checks.yml +++ b/roles/ceph-rgw/tasks/multisite/checks.yml @@ -1,23 +1,23 @@ --- -- name: Check if the realm already exists +- name: check if the realm already exists command: radosgw-admin realm get --rgw-realm={{ rgw_realm }} register: realmcheck failed_when: False changed_when: False -- name: Check if the zonegroup already exists +- name: check if the zonegroup already exists command: radosgw-admin zonegroup get --rgw-zonegroup={{ rgw_zonegroup }} register: zonegroupcheck failed_when: False changed_when: False -- name: Check if the zone already exists +- name: check if the zone already exists command: radosgw-admin zone get --rgw-zone={{ rgw_zone }} register: zonecheck failed_when: False changed_when: False -- name: Check if the system user already exists +- name: check if the system user already exists command: radosgw-admin user info --uid=zone.user register: usercheck failed_when: False diff --git a/roles/ceph-rgw/tasks/multisite/destroy.yml b/roles/ceph-rgw/tasks/multisite/destroy.yml index 8b608e0e2..db1226130 100644 --- a/roles/ceph-rgw/tasks/multisite/destroy.yml +++ b/roles/ceph-rgw/tasks/multisite/destroy.yml @@ -1,25 +1,25 @@ --- -- name: Delete the zone user +- name: delete the zone user command: radosgw-admin user rm --uid=zone.user run_once: true failed_when: false -- name: Delete the zone +- 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 +- name: delete the zonegroup command: radosgw-admin zonegroup delete --rgw-zonegroup={{ rgw_zonegroup }} run_once: true failed_when: false -- name: Delete the realm +- 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 +- name: delete zone from rgw stanza in ceph.conf lineinfile: dest: /etc/ceph/ceph.conf regexp: "rgw_zone = {{ rgw_zonegroup }}-{{ rgw_zone }}" diff --git a/roles/ceph-rgw/tasks/multisite/main.yml b/roles/ceph-rgw/tasks/multisite/main.yml index b58073061..cc874ba00 100644 --- a/roles/ceph-rgw/tasks/multisite/main.yml +++ b/roles/ceph-rgw/tasks/multisite/main.yml @@ -1,22 +1,22 @@ --- -- name: Include multisite checks +- name: include multisite checks include: checks.yml # Include the tasks depending on the zone type -- name: Include master multisite tasks +- name: include master multisite tasks include: master.yml when: "rgw_zonemaster is defined and rgw_zonemaster" # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) static: False -- name: Include secondary multisite tasks +- name: include secondary multisite tasks include: secondary.yml when: "rgw_zonesecondary is defined and rgw_zonesecondary" # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) static: False # Continue with common tasks -- name: Add zone to RGW stanza in ceph.conf +- name: add zone to rgw stanza in ceph.conf lineinfile: dest: /etc/ceph/ceph.conf regexp: "{{ ansible_host }}" diff --git a/roles/ceph-rgw/tasks/multisite/master.yml b/roles/ceph-rgw/tasks/multisite/master.yml index 94b5c5e91..ff818465b 100644 --- a/roles/ceph-rgw/tasks/multisite/master.yml +++ b/roles/ceph-rgw/tasks/multisite/master.yml @@ -1,26 +1,26 @@ --- -- name: Create the realm +- name: create the realm command: radosgw-admin realm create --rgw-realm={{ rgw_realm }} --default run_once: true when: ("No such file or directory" in realmcheck.stderr) and rgw_zonemaster notify: - update period -- name: Create the zonegroup +- name: create the zonegroup command: radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints=http://{{ ansible_fqdn }}:{{ radosgw_civetweb_port }} --master --default run_once: true when: ("No such file or directory" in zonegroupcheck.stderr) and rgw_zonemaster notify: - update period -- name: Create the zone +- name: create the zone command: radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ ansible_fqdn }}:{{ radosgw_civetweb_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default --master run_once: true when: ("No such file or directory" in zonecheck.stderr) and rgw_zonemaster notify: - update period -- name: Create the zone user +- name: create the zone user command: radosgw-admin user create --uid=zone.user --display-name="Zone User" --access-key={{ system_access_key }} --secret={{ system_secret_key }} --system run_once: true when: "'could not fetch user info: no user info saved' in usercheck.stderr" diff --git a/roles/ceph-rgw/tasks/multisite/secondary.yml b/roles/ceph-rgw/tasks/multisite/secondary.yml index dd0f671ee..90dd03225 100644 --- a/roles/ceph-rgw/tasks/multisite/secondary.yml +++ b/roles/ceph-rgw/tasks/multisite/secondary.yml @@ -1,31 +1,31 @@ --- -- name: Fetch the realm +- name: fetch the realm command: radosgw-admin realm pull --url=http://{{ rgw_pullhost }}:{{ radosgw_civetweb_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} run_once: true when: ("No such file or directory" in realmcheck.stderr) notify: - update period -- name: Fetch the period +- name: fetch the period command: radosgw-admin period pull --url=http://{{ rgw_pullhost }}:{{ radosgw_civetweb_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} run_once: true when: ("No such file or directory" in realmcheck.stderr) notify: - update period -- name: Set default realm +- name: set default realm command: radosgw-admin realm default --rgw-realm={{ rgw_realm }} run_once: true notify: - update period # Might not need to update period here -- name: Set default zonegroup +- name: set default zonegroup command: radosgw-admin zonegroup default --rgw-zonegroup={{ rgw_zonegroup }} run_once: true notify: - update period # Might not need to update period here -- name: Create the zone +- name: create the zone command: radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ ansible_hostname }}:{{ radosgw_civetweb_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default run_once: true when: ("No such file or directory" in zonecheck.stderr)