From bf672f14fe8de3405dbd4d9bb31ca40a3e97ed78 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 8 Apr 2019 13:56:01 +0200 Subject: [PATCH] mgr: manage mgr modules when mgr and mon are collocated When mgrs are implicitly collocated on monitors (no mgrs in mgrs group). That include was skipped because of this condition : `inventory_hostname == groups[mgr_group_name][0]` Signed-off-by: Guillaume Abrioux (cherry picked from commit cbfdbab177e3aed4132be3b1f175c85b412dbe97) --- roles/ceph-mgr/tasks/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/ceph-mgr/tasks/main.yml b/roles/ceph-mgr/tasks/main.yml index 8a1310a68..6a92a2663 100644 --- a/roles/ceph-mgr/tasks/main.yml +++ b/roles/ceph-mgr/tasks/main.yml @@ -18,5 +18,6 @@ - name: include mgr_modules.yml include_tasks: mgr_modules.yml when: - - ceph_mgr_modules|length > 0 - - inventory_hostname == groups[mgr_group_name][0] \ No newline at end of file + - ceph_mgr_modules | length > 0 + - ((groups[mgr_group_name] | default([]) | length == 0 and inventory_hostname == groups[mon_group_name] | last) or + (groups[mgr_group_name] | default([]) | length > 0 and inventory_hostname == groups[mgr_group_name] | last)) \ No newline at end of file