kayobe/ansible/roles/libvirt-vm/tasks/destroy-volumes.yml

12 lines
304 B
YAML

---
- name: Ensure the VM volumes do not exist
script: >
destroy_virt_volume.sh
{{ item.name }}
{{ item.pool }}
with_items: "{{ libvirt_vm_volumes }}"
register: volume_result
changed_when:
- volume_result | success
- (volume_result.stdout | from_json).changed | default(True)