From: Guillaume Abrioux Date: Tue, 7 Aug 2018 12:46:07 +0000 (+0200) Subject: mgr: backward compatibility for module management X-Git-Tag: v3.1.0rc18~26 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=95c28e78d1e875fcc2f7c86fedcc07a27308b8fe;p=ceph-ansible.git mgr: backward compatibility for module management Follow up on 3abc253fecc91f29c90e23ae95e1b83f8ffd3de6 The structure had even changed within `luminous` release. It was first: ``` { "enabled_modules": [ "balancer", "dashboard", "restful", "status" ], "disabled_modules": [ "influx", "localpool", "prometheus", "selftest", "zabbix" ] } ``` Then it changed for: ``` { "enabled_modules": [ "status" ], "disabled_modules": [ "balancer", "dashboard", "influx", "localpool", "prometheus", "restful", "selftest", "zabbix" ] } ``` and finally: ``` { "enabled_modules": [ "status" ], "disabled_modules": [ { "name": "balancer", "can_run": true, "error_string": "" }, { "name": "dashboard", "can_run": true, "error_string": "" } ] } ``` Signed-off-by: Guillaume Abrioux (cherry picked from commit 36942af6983d60666f3f8a1a06b352a440a6c0da) --- diff --git a/roles/ceph-mgr/tasks/main.yml b/roles/ceph-mgr/tasks/main.yml index 713be8da4..e2b480c64 100644 --- a/roles/ceph-mgr/tasks/main.yml +++ b/roles/ceph-mgr/tasks/main.yml @@ -31,7 +31,7 @@ - name: set _disabled_ceph_mgr_modules fact set_fact: - _disabled_ceph_mgr_modules: "{% if ceph_release_num[ceph_release] > ceph_release_num['luminous'] %}{{ _ceph_mgr_modules['disabled_modules'] | map(attribute='name') | list }}{% else %}{{ _ceph_mgr_modules['disabled_modules'] }}{% endif %}" + _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 %}" when: - ceph_release_num[ceph_release] >= ceph_release_num['luminous'] @@ -51,5 +51,5 @@ with_items: "{{ ceph_mgr_modules }}" delegate_to: "{{ groups[mon_group_name][0] }}" when: - - item in _disabled_ceph_mgr_modules + - (item in _disabled_ceph_mgr_modules or _disabled_ceph_mgr_modules == []) - ceph_release_num[ceph_release] >= ceph_release_num['luminous']