From c1e4529b0e44329f561fc46ec96bd081cdd6d38c Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 11 Apr 2019 09:16:28 +0200 Subject: [PATCH] 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 --- infrastructure-playbooks/rolling_update.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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