]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mgr: backward compatibility for module management
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 7 Aug 2018 12:46:07 +0000 (14:46 +0200)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Mon, 13 Aug 2018 16:18:52 +0000 (16:18 +0000)
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 <gabrioux@redhat.com>
(cherry picked from commit 36942af6983d60666f3f8a1a06b352a440a6c0da)

roles/ceph-mgr/tasks/main.yml

index 44c42ec67c059dd06bb8a0c5748f18eb43853801..4e6037695b079bfea6938141ff53ce46bdc9390a 100644 (file)
@@ -28,7 +28,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']
 
@@ -48,5 +48,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']