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 <gabrioux@redhat.com>
(cherry picked from commit
cbfdbab177e3aed4132be3b1f175c85b412dbe97)
- 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