From: Guillaume Abrioux Date: Thu, 11 Apr 2019 07:16:28 +0000 (+0200) Subject: update: fix undefined error when no mgr group is declared X-Git-Tag: v4.0.0rc4~47 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2581c4d5110b2255c82a3e444d0962a74b545b02;p=ceph-ansible.git 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 (cherry picked from commit c1e4529b0e44329f561fc46ec96bd081cdd6d38c) --- diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 0ec4ccf20..5b6449e3b 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -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