#8078 ansible: idempotent volume mounts in OpenStack
Closed: Fixed 6 months ago by praiskup. Opened 6 months ago by praiskup.

I'd like to apply:

commit f9826b920ddcc05395ed9c1a1762bd7f19578507 (HEAD -> master)
Author:     Pavel Raiskup <praiskup@redhat.com>
AuthorDate: Sat Aug 10 13:54:04 2019 +0200
Commit:     Pavel Raiskup <praiskup@redhat.com>
CommitDate: Sat Aug 10 14:03:56 2019 +0200

    persistent_cloud: make volume mount task idempotent

diff --git a/tasks/persistent_cloud.yml b/tasks/persistent_cloud.yml
index c3cf29460..103bb1d82 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

... to make the run of copr's playbooks more idempotent, though it affects more services than just copr. So I'd like to get ACK first :-) that there's no hidden magic I don't see on the first sight.

Ok, I was not scared enough today :-) and pushed .. please let me know if I caused any issue.

Metadata Update from @praiskup:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

6 months ago

Login to comment on this ticket.