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>
(cherry picked from commit c1e4529b0e)
pull/3850/head
Guillaume Abrioux 2019-04-11 09:16:28 +02:00 committed by Dimitri Savineau
parent f5f8d264e2
commit 2581c4d511
1 changed files with 2 additions and 2 deletions

View File

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