]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mgr: do not copy all keyrings on all mgr
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 15 Oct 2019 15:02:18 +0000 (17:02 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 16 Oct 2019 04:45:33 +0000 (06:45 +0200)
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 <gabrioux@redhat.com>
(cherry picked from commit cb8023172541d09979cc0c224c56aba43674d892)

roles/ceph-mgr/tasks/common.yml

index 1218f4f6c9a537e1bda31f57edbf4e9419e95e2c..5da5a8b8ff15ee3ecd1909a17f84aeee1c5c3b72 100644 (file)
 
     - 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