2016-08-08 11:16:15 +08:00
|
|
|
---
|
2019-10-05 03:31:25 +08:00
|
|
|
- name: create default realm
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin realm create --cluster={{ cluster }} --rgw-realm={{ item.realm }} --default"
|
2017-09-19 06:33:23 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2016-08-08 11:16:15 +08:00
|
|
|
run_once: true
|
2019-10-05 03:31:25 +08:00
|
|
|
with_items: "{{ realms }}"
|
|
|
|
when:
|
|
|
|
- realms is defined
|
|
|
|
- realms | length == 1
|
2016-08-08 11:16:15 +08:00
|
|
|
|
2019-10-05 03:31:25 +08:00
|
|
|
- name: create the realm(s)
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin realm create --cluster={{ cluster }} --rgw-realm={{ item.realm }}"
|
2017-09-19 06:33:23 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2016-08-08 11:16:15 +08:00
|
|
|
run_once: true
|
2019-10-05 03:31:25 +08:00
|
|
|
with_items: "{{ realms }}"
|
|
|
|
when:
|
|
|
|
- realms is defined
|
|
|
|
- realms | length > 1
|
2016-08-08 11:16:15 +08:00
|
|
|
|
2019-10-05 03:31:25 +08:00
|
|
|
- name: create default master zonegroup(s)
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin zonegroup create --cluster={{ cluster }} --rgw-realm={{ item.realm }} --rgw-zonegroup={{ item.zonegroup }} --default --master"
|
2017-09-19 06:33:23 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2016-08-08 11:16:15 +08:00
|
|
|
run_once: true
|
2019-10-05 03:31:25 +08:00
|
|
|
with_items: "{{ zonegroups }}"
|
|
|
|
when:
|
|
|
|
- zonegroups is defined
|
|
|
|
- zonegroups | length == 1
|
|
|
|
- item.is_master | bool
|
2016-08-08 11:16:15 +08:00
|
|
|
|
2019-10-05 03:31:25 +08:00
|
|
|
- name: create default zonegroup(s)
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin zonegroup create --cluster={{ cluster }} --rgw-realm={{ item.realm }} --rgw-zonegroup={{ item.zonegroup }} --default"
|
2017-09-19 06:33:23 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2016-08-08 11:16:15 +08:00
|
|
|
run_once: true
|
2019-10-05 03:31:25 +08:00
|
|
|
with_items: "{{ zonegroups }}"
|
|
|
|
when:
|
|
|
|
- zonegroups is defined
|
|
|
|
- zonegroups | length == 1
|
|
|
|
- not item.is_master | bool
|
2019-02-01 04:43:21 +08:00
|
|
|
|
2019-10-05 03:31:25 +08:00
|
|
|
- name: create master zonegroup(s)
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin zonegroup create --cluster={{ cluster }} --rgw-realm={{ item.realm }} --rgw-zonegroup={{ item.zonegroup }} --master"
|
2019-02-01 04:43:21 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
2019-10-05 03:31:25 +08:00
|
|
|
with_items: "{{ zonegroups }}"
|
|
|
|
when:
|
|
|
|
- zonegroups is defined
|
|
|
|
- zonegroups | length > 1
|
|
|
|
- item.is_master | bool
|
|
|
|
|
|
|
|
- name: create non-master non-default zonegroup(s)
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin zonegroup create --cluster={{ cluster }} --rgw-realm={{ item.realm }} --rgw-zonegroup={{ item.zonegroup }}"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
|
|
|
with_items: "{{ zonegroups }}"
|
|
|
|
when:
|
|
|
|
- zonegroups is defined
|
|
|
|
- zonegroups | length > 1
|
|
|
|
- not item.is_master | bool
|
|
|
|
|
|
|
|
- name: create the default master zone
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin zone create --cluster={{ cluster }} --rgw-realm={{ item.realm }} --rgw-zonegroup={{ item.zonegroup }} --rgw-zone={{ item.zone }} --access-key={{ item.access_key }} --secret={{ item.secret_key }} --master --default"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
|
|
|
with_items: "{{ zones }}"
|
|
|
|
when:
|
|
|
|
- zones is defined
|
|
|
|
- zones | length == 1
|
|
|
|
- item.is_master | bool
|
|
|
|
|
|
|
|
- name: create the master zone(s)
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin zone create --cluster={{ cluster }} --rgw-realm={{ item.realm }} --rgw-zonegroup={{ item.zonegroup }} --rgw-zone={{ item.zone }} --access-key={{ item.access_key }} --secret={{ item.secret_key }} --master"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
|
|
|
with_items: "{{ zones }}"
|
|
|
|
when:
|
|
|
|
- zones is defined
|
|
|
|
- zones | length > 1
|
|
|
|
- item.is_master | bool
|
|
|
|
|
|
|
|
- name: add endpoints to their zone(s)
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin zone modify --cluster={{ cluster }} --rgw-realm={{ item.realm }} --rgw-zonegroup={{ item.zonegroup }} --rgw-zone={{ item.zone }} --endpoints {{ item.endpoints }}"
|
|
|
|
with_items: "{{ zone_endpoints_list }}"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
|
|
|
when:
|
|
|
|
- zone_endpoints_list is defined
|
|
|
|
- item.is_master | bool
|
|
|
|
|
|
|
|
- name: update period for zone creation
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin --cluster={{ cluster }} --rgw-realm={{ item.realm }} --rgw-zonegroup={{ item.zonegroup }} --rgw-zone={{ item.zone }} period update --commit"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
|
|
|
with_items: "{{ zone_endpoints_list }}"
|
|
|
|
when:
|
|
|
|
- zone_endpoints_list is defined
|
|
|
|
- item.is_master | bool
|
|
|
|
|
|
|
|
- name: include_tasks create_zone_user.yml
|
|
|
|
include_tasks: create_zone_user.yml
|