ceph-ansible/roles/ceph-rgw/tasks/multisite/create_zone_user.yml

28 lines
1.2 KiB
YAML

---
- name: create list zone_users
set_fact:
zone_users: "{{ zone_users | default([]) | union([{ 'realm': item.rgw_realm, 'zonegroup': item.rgw_zonegroup, 'zone': item.rgw_zone, 'system_access_key': item.system_access_key, 'system_secret_key': item.system_secret_key, 'user': item.rgw_zone_user, 'display_name': item.rgw_zone_user_display_name }]) }}"
loop: "{{ rgw_instances_all }}"
run_once: true
when:
- hostvars[item.host]['rgw_zonemaster'] | bool
- hostvars[item.host]['rgw_zonegroupmaster'] | bool
- name: create the zone user(s)
radosgw_user:
name: "{{ item.user }}"
cluster: "{{ cluster }}"
display_name: "{{ item.display_name }}"
access_key: "{{ item.system_access_key }}"
secret_key: "{{ item.system_secret_key }}"
realm: "{{ item.realm }}"
zonegroup: "{{ item.zonegroup }}"
zone: "{{ item.zone }}"
system: true
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
loop: "{{ zone_users }}"
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 }}"