]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mgr: manage mgr modules when mgr and mon are collocated
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 8 Apr 2019 11:56:01 +0000 (13:56 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 9 Apr 2019 08:59:32 +0000 (10:59 +0200)
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)

roles/ceph-mgr/tasks/main.yml

index 8a1310a68ca2718440ca2874cfdb1889e097f2c4..6a92a266309b53b91e3cf3bacd7e19aedbe9e50b 100644 (file)
@@ -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