From fd36433826b73d145b37902dcfe3e8b6d473b909 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Thu, 9 Jul 2020 11:19:41 -0400 Subject: [PATCH] cephadm-adopt: copy client.admin keyring The ceph config assimilate-conf command requires the client.admin keyring which isn't present on all nodes most of the time. Signed-off-by: Dimitri Savineau --- infrastructure-playbooks/cephadm-adopt.yml | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index db4128927..983e5a94c 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -249,6 +249,29 @@ set_fact: ceph_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph:/var/lib/ceph:z -v /var/run/ceph:/var/run/ceph:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'ceph' }}" + - name: get the client.admin keyring + command: "{{ ceph_cmd }} --cluster {{ cluster }} auth get client.admin" + changed_when: false + run_once: true + delegate_to: '{{ groups[mon_group_name][0] }}' + register: client_admin_keyring + + - name: copy the client.admin keyring + copy: + dest: "/etc/ceph/{{ cluster }}.client.admin.keyring" + content: "{{ client_admin_keyring.stdout + '\n' }}" + owner: "{{ ceph_uid | int if containerized_deployment | bool else 'ceph' }}" + group: "{{ ceph_uid | int if containerized_deployment | bool else 'ceph' }}" + mode: "{{ ceph_keyring_permissions }}" + run_once: true + delegate_to: "{{ item }}" + with_items: + - "{{ groups.get(osd_group_name, []) }}" + - "{{ groups.get(mds_group_name, []) }}" + - "{{ groups.get(rgw_group_name, []) }}" + - "{{ groups.get(mgr_group_name, []) }}" + - "{{ groups.get(rbdmirror_group_name, []) }}" + - name: assimilate ceph configuration command: "{{ ceph_cmd }} --cluster {{ cluster }} config assimilate-conf -i /etc/ceph/{{ cluster }}.conf" changed_when: false