rgw s3 auth use keystone = {{ radosgw_s3_auth_use_keystone }}
nss db path = {{ radosgw_nss_db_path }}
{% endif %}
+{% if rgw_zonegroup is defined and rgw_zone is defined %}
+rgw zone = {{ rgw_zonegroup }}-{{ rgw_zone }}
+{% endif %}
{% endif %}
{% endfor %}
{% endif %}
---
-- include: multisite.yml
- when: rgw_zone is defined and rgw_multisite and ( is_jewel or is_after_jewel )
+- name: update period
+ command: radosgw-admin period update --commit
- include: openstack-keystone.yml
when: radosgw_keystone
-- include: multisite.yml
+- include: ./multisite/main.yml
when: rgw_zone is defined and rgw_multisite and ( is_jewel or is_after_jewel )
- include: start_radosgw.yml
+++ /dev/null
----
-- 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: 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)
- notify:
- - update period
-
-- 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: Create the zonegroup
- command: radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints=http://{{ ansible_hostname }}:8080 --master --default
- run_once: true
- when: ('No such file or directory' in zonegroupcheck.stderr) and rgw_zonemaster
- notify:
- - update period
-
-- 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: Create the zone
- command: radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ ansible_hostname }}:8080 --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: Check if the system user already exists
- command: radosgw-admin user info --uid=zone.user
- register: usercheck
- failed_when: False
- changed_when: False
-
-- 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"
- notify:
- - update period
--- /dev/null
+---
+- 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
+ command: radosgw-admin zonegroup get --rgw-zonegroup={{ rgw_zonegroup }}
+ register: zonegroupcheck
+ failed_when: False
+ changed_when: False
+
+- 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
+ command: radosgw-admin user info --uid=zone.user
+ register: usercheck
+ failed_when: False
+ changed_when: False
--- /dev/null
+---
+- name: Delete the zone user
+ command: radosgw-admin user rm --uid=zone.user
+ 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
+ notify:
+ - update period
+
+- name: Delete the zonegroup
+ command: radosgw-admin zonegroup delete --rgw-zonegroup={{ rgw_zonegroup }}
+ run_once: true
+ failed_when: false
+ notify:
+ - update period
+
+- name: Delete the realm
+ command: radosgw-admin realm delete --rgw-realm={{ rgw_realm }}
+ run_once: true
+ failed_when: false
+ notify:
+ - update period
+
--- /dev/null
+---
+- include: checks.yml
+
+# Include the tasks depending on the zone type
+- include: master.yml
+ when: "{{ rgw_zonemaster }} is defined and {{ rgw_zonemaster }}"
+
+- include: secondary.yml
+ when: "{{ rgw_zonesecondary }} is defined and {{ rgw_zonesecondary }}"
+
+## This is currently handled in the ceph-common ceph.conf template
+## Probably should do here so we can use a restart handler for the rgw
+#- name: Add zone to RGW stanza in ceph.conf
+# lineinfile:
+# dest: /etc/ceph/ceph.conf
+# regexp: "{{ ansible_host }}"
+# insertafter: "^[client.rgw.{{ ansible_host }}]"
+# line: "rgw_zone={{ rgw_zonegroup }}-{{ rgw_zone }}"
+# state: present
--- /dev/null
+---
+- 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
+ command: radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints=http://{{ ansible_hostname }}:8080 --master --default
+ run_once: true
+ when: ("No such file or directory" in zonegroupcheck.stderr) and rgw_zonemaster
+ notify:
+ - update period
+
+- name: Create the zone
+ command: radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ ansible_hostname }}:8080 --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
+ 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"
+ notify:
+ - update period
--- /dev/null
+---
+- 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: 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: Fetch the realm (Secondary)
+ command: radosgw-admin realm pull --url=http://{{ rgw_pullhost }}:8080 --access-key={{ system_access_key }} --secret={{ system_secret_key }}
+ run_once: true
+ when: ("No such file or directory" in realmcheck.stderr) and rgw_zonesecondary
+ notify:
+ - update period
+
+- name: Fetch the realm (Secondary)
+ command: radosgw-admin period pull --url=http://{{ rgw_pullhost }}:8080 --access-key={{ system_access_key }} --secret={{ system_secret_key }}
+ run_once: true
+ when: ("No such file or directory" in realmcheck.stderr) and rgw_zonesecondary
+ notify:
+ - update period
+
+- 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: Create the zonegroup
+ command: radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints=http://{{ ansible_hostname }}:8080 --master --default
+ run_once: true
+ when: ("No such file or directory" in zonegroupcheck.stderr) and rgw_zonemaster
+ notify:
+ - update period
+
+- 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: Create the zone
+ command: radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ ansible_hostname }}:8080 --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: Check if the system user already exists
+ command: radosgw-admin user info --uid=zone.user
+ register: usercheck
+ failed_when: False
+ changed_when: False
+
+- 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"
+ notify:
+ - update period
+
+#- name: Add zone to RGW stanza in ceph.conf
+# lineinfile:
+# dest: /etc/ceph/ceph.conf
+# regexp: "{{ ansible_host }}"
+# insertafter: "^[client.rgw.{{ ansible_host }}]"
+# line: "rgw_zone={{ rgw_zonegroup }}-{{ rgw_zone }}"
+# state: present