2016-05-11 00:29:27 +08:00
|
|
|
---
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Copy ceph admin keyring
|
|
|
|
when:
|
|
|
|
- cephx | bool
|
|
|
|
- copy_admin_key | bool
|
2019-09-25 01:13:31 +08:00
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Get keys from monitors
|
2020-10-24 03:19:53 +08:00
|
|
|
ceph_key:
|
|
|
|
name: client.admin
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
output_format: plain
|
|
|
|
state: info
|
|
|
|
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 }}"
|
|
|
|
register: _admin_key
|
2019-09-25 01:13:31 +08:00
|
|
|
delegate_to: "{{ groups.get(mon_group_name)[0] }}"
|
2019-10-02 15:57:50 +08:00
|
|
|
run_once: true
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2019-09-25 01:13:31 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Copy ceph key(s) if needed
|
|
|
|
ansible.builtin.copy:
|
2020-10-24 03:19:53 +08:00
|
|
|
dest: "/etc/ceph/{{ cluster }}.client.admin.keyring"
|
|
|
|
content: "{{ _admin_key.stdout + '\n' }}"
|
2020-09-26 00:15:02 +08:00
|
|
|
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
|
|
|
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
2019-09-25 01:13:31 +08:00
|
|
|
mode: "{{ ceph_keyring_permissions }}"
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|