From: Guillaume Abrioux Date: Tue, 15 Oct 2019 15:02:18 +0000 (+0200) Subject: mgr: do not copy all keyrings on all mgr X-Git-Tag: v5.0.0alpha1~45 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cb8023172541d09979cc0c224c56aba43674d892;p=ceph-ansible.git 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 --- 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