Mark Goddard c01f5834cb Add kayobe seed vm deprovision command
This command will destroy the seed VM and all associated data volumes.
2017-08-07 12:08:41 +00:00

21 lines
506 B
YAML

---
# The destroyed state does not seem to be idempotent, so check whether the VM
# exists before destroying it.
- name: Check the VM's status
virt:
name: "{{ libvirt_vm_name }}"
command: list_vms
register: result
- block:
- name: Ensure the VM is absent
virt:
name: "{{ libvirt_vm_name }}"
state: destroyed
- name: Ensure the VM is undefined
virt:
name: "{{ libvirt_vm_name }}"
command: undefine
when: libvirt_vm_name in result.list_vms