From: Guillaume Abrioux Date: Mon, 8 Apr 2019 11:56:01 +0000 (+0200) Subject: mgr: manage mgr modules when mgr and mon are collocated X-Git-Tag: v5.0.0alpha1~437 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=cbfdbab177e3aed4132be3b1f175c85b412dbe97;p=ceph-ansible.git 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 --- 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