update: fix undefined error when no mgr group is declared

if mgr group isn't defined in inventory, that task will fail with
undefined error.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/3791/head
Guillaume Abrioux 2019-04-11 09:16:28 +02:00
parent 7e0adca7a4
commit c1e4529b0e
1 changed files with 2 additions and 2 deletions

View File

@ -172,8 +172,8 @@
name: ceph-mgr@{{ ansible_hostname }} name: ceph-mgr@{{ ansible_hostname }}
masked: yes masked: yes
when: when:
- inventory_hostname in groups[mgr_group_name] - inventory_hostname in groups[mgr_group_name] | default([])
or groups[mgr_group_name] | length == 0 or groups[mgr_group_name] | default([]) | length == 0
- import_role: - import_role:
name: ceph-handler name: ceph-handler