2018-03-05 06:06:48 +08:00
|
|
|
---
|
|
|
|
# If admin key has been copied to the RGWs, we can run the command from them.
|
2018-05-31 23:01:44 +08:00
|
|
|
- name: create rgw pools if rgw_create_pools is defined
|
2018-03-05 06:06:48 +08:00
|
|
|
command: "{{ docker_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool create {{ item.key }} {{ item.value.pg_num }}"
|
|
|
|
changed_when: false
|
|
|
|
run_once: true
|
2018-05-31 23:01:44 +08:00
|
|
|
with_dict: "{{ rgw_create_pools }}"
|
2018-03-05 06:06:48 +08:00
|
|
|
when:
|
|
|
|
- copy_admin_key
|
|
|
|
|
|
|
|
# If no admin key has been copied to the RGWs, we have to run the command from the first monitor.
|
|
|
|
- name: set_fact docker_exec_mon_cmd
|
|
|
|
set_fact:
|
|
|
|
docker_exec_mon_cmd: "docker exec ceph-mon-{{ hostvars[groups.get(mon_group_name)[0]]['ansible_hostname'] }}"
|
|
|
|
when:
|
|
|
|
- not copy_admin_key
|
|
|
|
|
|
|
|
# If no admin key has been copied to the RGWs, we have to run the command from the first monitor.
|
2018-05-31 23:01:44 +08:00
|
|
|
- name: create rgw pools if rgw_create_pools is defined, delegated to first monitor
|
2018-03-05 06:06:48 +08:00
|
|
|
command: "{{ docker_exec_mon_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool create {{ item.key }} {{ item.value.pg_num }}"
|
|
|
|
changed_when: false
|
|
|
|
run_once: true
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2018-05-31 23:01:44 +08:00
|
|
|
with_dict: "{{ rgw_create_pools }}"
|
2018-03-05 06:06:48 +08:00
|
|
|
when:
|
|
|
|
- not copy_admin_key
|