2016-08-08 11:16:15 +08:00
|
|
|
---
|
2019-10-05 03:31:25 +08:00
|
|
|
- name: create the realm(s)
|
2020-08-06 21:48:58 +08:00
|
|
|
radosgw_realm:
|
|
|
|
name: "{{ item }}"
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
default: "{{ true if realms | length == 1 else false }}"
|
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
|
2020-08-06 21:48:58 +08:00
|
|
|
loop: "{{ realms }}"
|
|
|
|
when: realms is defined
|
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2016-08-08 11:16:15 +08:00
|
|
|
|
2020-03-09 18:05:01 +08:00
|
|
|
- name: create zonegroup(s)
|
2020-08-13 05:43:29 +08:00
|
|
|
radosgw_zonegroup:
|
|
|
|
name: "{{ item.zonegroup }}"
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
realm: "{{ item.realm }}"
|
|
|
|
default: "{{ true if zonegroups | length == 1 else false }}"
|
|
|
|
master: "{{ true if item.is_master | bool else false }}"
|
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
|
2020-08-13 05:43:29 +08:00
|
|
|
loop: "{{ zonegroups }}"
|
|
|
|
when: zonegroups is defined
|
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2016-08-08 11:16:15 +08:00
|
|
|
|
2020-03-09 18:05:01 +08:00
|
|
|
- name: create the master zone
|
|
|
|
command: "{{ container_exec_cmd }} radosgw-admin zone create --cluster={{ cluster }} --rgw-realm={{ item.item.realm }} --rgw-zonegroup={{ item.item.zonegroup }} --rgw-zone={{ item.item.zone }} --access-key={{ item.item.system_access_key }} --secret={{ item.item.system_secret_key }} {{ '--default' if zones | length == 1 else '' }} --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
|
2020-03-09 18:05:01 +08:00
|
|
|
loop: "{{ zonecheck.results }}"
|
2019-10-05 03:31:25 +08:00
|
|
|
when:
|
|
|
|
- zones is defined
|
2020-03-09 18:05:01 +08:00
|
|
|
- zones | length > 0
|
|
|
|
- item.item.is_master | bool
|
|
|
|
- "'No such file or directory' in item.stderr"
|
2019-10-05 03:31:25 +08:00
|
|
|
|
2020-06-06 05:21:27 +08:00
|
|
|
- name: add endpoints to their zone groups(s)
|
2020-08-13 05:43:29 +08:00
|
|
|
radosgw_zonegroup:
|
|
|
|
name: "{{ item.zonegroup }}"
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
realm: "{{ item.realm }}"
|
|
|
|
endpoints: "{{ item.endpoints.split(',') }}"
|
2020-06-06 05:21:27 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
2020-08-13 05:43:29 +08:00
|
|
|
loop: "{{ zone_endpoints_list }}"
|
2020-06-06 05:21:27 +08:00
|
|
|
when:
|
|
|
|
- zone_endpoints_list is defined
|
|
|
|
- item.is_master | bool
|
2020-08-13 05:43:29 +08:00
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2020-06-06 05:21:27 +08:00
|
|
|
|
2019-10-05 03:31:25 +08:00
|
|
|
- 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 }}"
|
2020-03-09 18:05:01 +08:00
|
|
|
loop: "{{ zone_endpoints_list }}"
|
2019-10-05 03:31:25 +08:00
|
|
|
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
|
2020-03-09 18:05:01 +08:00
|
|
|
loop: "{{ zone_endpoints_list }}"
|
2019-10-05 03:31:25 +08:00
|
|
|
when:
|
|
|
|
- zone_endpoints_list is defined
|
|
|
|
- item.is_master | bool
|
|
|
|
|
|
|
|
- name: include_tasks create_zone_user.yml
|
|
|
|
include_tasks: create_zone_user.yml
|