mirror of https://github.com/ceph/ceph-ansible.git
94 lines
3.5 KiB
YAML
94 lines
3.5 KiB
YAML
---
|
|
- name: create the realm(s)
|
|
radosgw_realm:
|
|
name: "{{ item }}"
|
|
cluster: "{{ cluster }}"
|
|
default: "{{ true if realms | length == 1 else false }}"
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
run_once: true
|
|
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 }}"
|
|
|
|
- name: create zonegroup(s)
|
|
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 }}"
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
run_once: true
|
|
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 }}"
|
|
|
|
- name: create the master zone(s)
|
|
radosgw_zone:
|
|
name: "{{ item.zone }}"
|
|
cluster: "{{ cluster }}"
|
|
realm: "{{ item.realm }}"
|
|
zonegroup: "{{ item.zonegroup }}"
|
|
access_key: "{{ item.system_access_key }}"
|
|
secret_key: "{{ item.system_secret_key }}"
|
|
default: "{{ true if zones | length == 1 else false }}"
|
|
master: true
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
run_once: true
|
|
loop: "{{ zones }}"
|
|
when:
|
|
- zones is defined
|
|
- item.is_master | bool
|
|
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 }}"
|
|
|
|
- name: add endpoints to their zone groups(s)
|
|
radosgw_zonegroup:
|
|
name: "{{ item.zonegroup }}"
|
|
cluster: "{{ cluster }}"
|
|
realm: "{{ item.realm }}"
|
|
endpoints: "{{ item.endpoints.split(',') }}"
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
run_once: true
|
|
loop: "{{ zone_endpoints_list }}"
|
|
when:
|
|
- zone_endpoints_list is defined
|
|
- item.is_master | bool
|
|
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 }}"
|
|
|
|
- name: add endpoints to their zone(s)
|
|
radosgw_zone:
|
|
name: "{{ item.zone }}"
|
|
cluster: "{{ cluster }}"
|
|
realm: "{{ item.realm }}"
|
|
zonegroup: "{{ item.zonegroup }}"
|
|
endpoints: "{{ item.endpoints.split(',') }}"
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
run_once: true
|
|
loop: "{{ zone_endpoints_list }}"
|
|
when:
|
|
- zone_endpoints_list is defined
|
|
- item.is_master | bool
|
|
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 }}"
|
|
|
|
- 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
|
|
loop: "{{ 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
|