]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mon: do not create unnecessarily mgr keyrings
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 27 Feb 2019 09:59:31 +0000 (10:59 +0100)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Wed, 27 Feb 2019 15:58:35 +0000 (15:58 +0000)
there's no need to generate mgr keyrings 'mgr.monX' when mgrs aren't
collocated with monitors.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-mon/tasks/ceph_keys.yml

index e03e299149ef7d0ab4ef21feca82f5c65f984c6e..e4855eacb96cc663bb4079bec4037d6ce8b4c5d5 100644 (file)
@@ -47,7 +47,8 @@
       CEPH_CONTAINER_BINARY: "{{ container_binary }}"
     with_items:
       - "{{ groups.get(mgr_group_name, []) }}" # this honors the condition where mgrs run on separate machines
-      - "{{ groups.get(mon_group_name, []) }}" # this honors the new rule where mgrs are always collocated with mons
+      - "{{ groups.get(mon_group_name, []) if groups.get(mgr_group_name, []) | length == 0 else [] }}" # this honors the new rule where mgrs are always collocated with mons
+    run_once: True
     delegate_to: "{{ groups[mon_group_name][0] }}"
 
   - name: copy ceph mgr key(s) to the ansible server
@@ -57,7 +58,7 @@
       flat: yes
     with_items:
       - "{{ groups.get(mgr_group_name, []) }}" # this honors the condition where mgrs run on separate machines
-      - "{{ groups.get(mon_group_name, []) }}" # this honors the new rule where mgrs are always collocated with mons
+      - "{{ groups.get(mon_group_name, []) if groups.get(mgr_group_name, []) | length == 0 else [] }}" # this honors the new rule where mgrs are always collocated with mons
     delegate_to: "{{ groups[mon_group_name][0] }}"
   when:
     - cephx