]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
update: fix undefined error when no mgr group is declared
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 11 Apr 2019 07:16:28 +0000 (09:16 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 11 Apr 2019 07:22:35 +0000 (09:22 +0200)
if mgr group isn't defined in inventory, that task will fail with
undefined error.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/rolling_update.yml

index 0ec4ccf201e838a2486c38ece5d2ded0c9a62c83..5b6449e3b75597a64bb03257ab83e7c4afdd1a29 100644 (file)
         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