From 50738ff5c0bd29c318006ebfbdab5e9d281f9674 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 15 Oct 2019 17:02:18 +0200 Subject: [PATCH] mgr: do not copy all keyrings on all mgr There is no need to loop over all mgr nodes to set this fact, it's even breaking deployments because it tries to copy all mgr keyring on all mgr. Closes: #4602 Signed-off-by: Guillaume Abrioux (cherry picked from commit cb8023172541d09979cc0c224c56aba43674d892) --- roles/ceph-mgr/tasks/common.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/ceph-mgr/tasks/common.yml b/roles/ceph-mgr/tasks/common.yml index 1218f4f6c..5da5a8b8f 100644 --- a/roles/ceph-mgr/tasks/common.yml +++ b/roles/ceph-mgr/tasks/common.yml @@ -51,15 +51,15 @@ - name: set_fact _mgr_keys set_fact: - _mgr_keys: "{{ _mgr_keys | default([{ 'name': 'client.admin', 'path': '/etc/ceph/' + cluster + '.client.admin.keyring', 'copy_key': copy_admin_key }]) + [{ 'name': 'mgr.' + hostvars[item]['ansible_hostname'], 'path': '/var/lib/ceph/mgr/' + cluster + '-' + hostvars[item]['ansible_hostname'] + '/keyring', 'copy_key': true }] }}" - with_items: "{{ groups.get(mgr_group_name, []) }}" + _mgr_keys: + - { 'name': 'client.admin', 'path': "/etc/ceph/{{ cluster }}.client.admin.keyring", 'copy_key': copy_admin_key } + - { 'name': "mgr.{{ ansible_hostname }}", 'path': "/var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring", 'copy_key': true } - name: get keys from monitors command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} auth get {{ item.name }}" register: _mgr_keys with_items: "{{ _mgr_keys }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}" - run_once: true when: - cephx | bool - item.copy_key | bool -- 2.39.5