]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mgr: improve/fix disabled modules check
authorDardo D Kleiner <dardokleiner@gmail.com>
Wed, 15 Aug 2018 12:50:19 +0000 (08:50 -0400)
committerSébastien Han <seb@redhat.com>
Mon, 20 Aug 2018 09:23:58 +0000 (11:23 +0200)
Follow up on 36942af6983d60666f3f8a1a06b352a440a6c0da

"disabled_modules" is always a list, it's the items in the list that
can be dicts in mimic.  Many ways to fix this, here's one.

Signed-off-by: Dardo D Kleiner <dardokleiner@gmail.com>
roles/ceph-mgr/tasks/main.yml

index e2b480c64bb3306e910921e691504cd5affccb7e..a2eda822d1fa3942f0ca01fce325a2fdb2e4465f 100644 (file)
@@ -31,7 +31,7 @@
 
 - name: set _disabled_ceph_mgr_modules fact
   set_fact:
-    _disabled_ceph_mgr_modules: "{% if _ceph_mgr_modules | type_debug == 'list' %}[]{% elif _ceph_mgr_modules.disabled_modules | type_debug == 'dict' %}{{ _ceph_mgr_modules['disabled_modules'] }}{% else %}{{ _ceph_mgr_modules['disabled_modules'] | map(attribute='name') | list }}{% endif %}"
+    _disabled_ceph_mgr_modules: "{% if _ceph_mgr_modules.disabled_modules | length == 0 %}[]{% elif _ceph_mgr_modules.disabled_modules[0] | type_debug != 'dict' %}{{ _ceph_mgr_modules['disabled_modules'] }}{% else %}{{ _ceph_mgr_modules['disabled_modules'] | map(attribute='name') | list }}{% endif %}"
   when:
     - ceph_release_num[ceph_release] >= ceph_release_num['luminous']