From 9a17e3ffe2d6b715d015f7628f477bcbb8d2c89d Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Fri, 4 Nov 2016 22:14:29 +0000 Subject: [PATCH] try and set this to default to avoid two fails on every cloud instance --- tasks/persistent_cloud.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/persistent_cloud.yml b/tasks/persistent_cloud.yml index 22bdd78197..25f3ad82aa 100644 --- a/tasks/persistent_cloud.yml +++ b/tasks/persistent_cloud.yml @@ -50,7 +50,7 @@ # Check that the volume is available # - local_action: shell nova --os-auth-url="{{os_auth_url}}" --os-username="admin" --os-password="{{ADMIN_PASS}}" --os-tenant-name={{inventory_tenant}} volume-list | grep ' {{item.volume_id}} ' | grep 'available' - with_items: "{{volumes}}" + with_items: "{{volumes}}|default([])" register: volume_available failed_when: volume_available.rc == 2 changed_when: volume_available.rc == 0 @@ -62,7 +62,7 @@ # If it is attach it. # - local_action: shell nova --os-auth-url="{{os_auth_url}}" --os-username="admin" --os-password="{{ADMIN_PASS}}" --os-tenant-name={{inventory_tenant}} volume-attach "{{inventory_instance_name}}" "{{item.volume_id}}" "{{item.device}}" - with_items: "{{volumes}}" + with_items: "{{volumes}}|default([])" ignore_errors: True failed_when: False when: volumes is defined and volume_available is defined and volume_available