From 7ddd7caf1ca61fe6c46e4445db7a691fbdc662ce Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Sat, 10 Aug 2019 13:54:04 +0200 Subject: [PATCH] persistent_cloud: make volume mount task idempotent --- 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 c3cf294605..103bb1d82f 100644 --- a/tasks/persistent_cloud.yml +++ b/tasks/persistent_cloud.yml @@ -48,10 +48,10 @@ # 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|default([]) }}" + with_items: "{{ volume_available.results|default([]) }}" ignore_errors: True failed_when: False - when: volumes is defined and volume_available is defined and volume_available + when: volumes is defined and volume_available is defined and item.changed - name: wait for he host to be hot local_action: wait_for host={{ public_ip }} port=22 delay=1 timeout=600