]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mgr: fix enabling of mgr module on mimic
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 18 Jun 2018 15:26:21 +0000 (17:26 +0200)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Fri, 13 Jul 2018 11:51:28 +0000 (11:51 +0000)
The data structure has slightly changed on mimic.

Prior to mimic, it used to be:

```
{
    "enabled_modules": [
        "status"
    ],
    "disabled_modules": [
        "balancer",
        "dashboard",
        "influx",
        "localpool",
        "prometheus",
        "restful",
        "selftest",
        "zabbix"
    ]
}
```

From mimic it looks like this:

```
{
    "enabled_modules": [
        "status"
    ],
    "disabled_modules": [
        {
            "name": "balancer",
            "can_run": true,
            "error_string": ""
        },
        {
            "name": "dashboard",
            "can_run": true,
            "error_string": ""
        }
    ]
}
```

This means we can't simply check if `item` is in `item in
_ceph_mgr_modules.disabled_modules`

the idea here is to use filter `map(attribute='name')` to build a list
when deploying mimic.

Fixes: #2766
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 3abc253fecc91f29c90e23ae95e1b83f8ffd3de6)

roles/ceph-mgr/tasks/main.yml

index e5874f14dc2f7be486cfe550679646869db8316f..2970daf375d3471222f361a53d61755aefd8c938 100644 (file)
@@ -17,6 +17,8 @@
   command: "{{ docker_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} --format json mgr module ls"
   register: _ceph_mgr_modules
   delegate_to: "{{ groups[mon_group_name][0] }}"
+  when:
+    - ceph_release_num[ceph_release] >= ceph_release_num['luminous']
 
 - name: set _ceph_mgr_modules fact (convert _ceph_mgr_modules.stdout to a dict)
   set_fact:
@@ -45,3 +47,6 @@
   command: "{{ docker_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} mgr module enable {{ item }}"
   with_items: "{{ ceph_mgr_modules }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
+  when:
+    - item in _ceph_mgr_modules.disabled_modules
+    - ceph_release_num[ceph_release] >= ceph_release_num['luminous']