From f68ad10bc9301dd260b75a161d0803bcae219a55 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 27 Feb 2019 10:59:31 +0100 Subject: [PATCH] mon: do not create unnecessarily mgr keyrings there's no need to generate mgr keyrings 'mgr.monX' when mgrs aren't collocated with monitors. Signed-off-by: Guillaume Abrioux --- roles/ceph-mon/tasks/ceph_keys.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/ceph-mon/tasks/ceph_keys.yml b/roles/ceph-mon/tasks/ceph_keys.yml index e03e29914..e4855eacb 100644 --- a/roles/ceph-mon/tasks/ceph_keys.yml +++ b/roles/ceph-mon/tasks/ceph_keys.yml @@ -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