2016-05-11 00:29:27 +08:00
|
|
|
---
|
2018-07-26 21:27:21 +08:00
|
|
|
- name: copy ceph admin keyring
|
2019-09-25 01:13:31 +08:00
|
|
|
block:
|
|
|
|
- name: get keys from monitors
|
|
|
|
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} auth get {{ item.name }}"
|
|
|
|
register: _client_keys
|
|
|
|
with_items:
|
|
|
|
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
|
|
|
|
delegate_to: "{{ groups.get(mon_group_name)[0] }}"
|
2019-10-02 15:57:50 +08:00
|
|
|
run_once: true
|
2019-09-25 01:13:31 +08:00
|
|
|
when:
|
|
|
|
- cephx | bool
|
|
|
|
- item.copy_key | bool
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2019-09-25 01:13:31 +08:00
|
|
|
|
|
|
|
- name: copy ceph key(s) if needed
|
|
|
|
copy:
|
|
|
|
dest: "{{ item.item.path }}"
|
|
|
|
content: "{{ item.stdout + '\n' }}"
|
|
|
|
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
|
|
|
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
|
|
|
mode: "{{ ceph_keyring_permissions }}"
|
|
|
|
with_items: "{{ _client_keys.results }}"
|
|
|
|
when:
|
|
|
|
- item.item.copy_key | bool
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2019-09-25 01:13:31 +08:00
|
|
|
when: cephx | bool
|