fixes to vm_destroy
This commit is contained in:
parent
50c451e94d
commit
2093fca5d2
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: create the vms
|
- name: destroy the vms
|
||||||
hosts: hv00
|
hosts: hv00
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
become: true
|
become: true
|
||||||
|
@ -21,16 +21,26 @@
|
|||||||
when: vm_name in vm_list.list_vms
|
when: vm_name in vm_list.list_vms
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: stop the vm
|
- name: shutdown the vm
|
||||||
community.libvirt.virt:
|
community.libvirt.virt:
|
||||||
state: shutdown
|
state: shutdown
|
||||||
name: "{{ vm_name }}"
|
name: "{{ vm_name }}"
|
||||||
|
|
||||||
- name: destroy the vm
|
# - name: destroy the vm
|
||||||
|
# community.libvirt.virt:
|
||||||
|
# state: destroyed
|
||||||
|
# name: "{{ vm_name }}"
|
||||||
|
|
||||||
|
- name: undefine the vm
|
||||||
community.libvirt.virt:
|
community.libvirt.virt:
|
||||||
state: destroyed
|
state: undefine
|
||||||
name: "{{ vm_name }}"
|
name: "{{ vm_name }}"
|
||||||
|
|
||||||
|
- name: delete the firmware vars file
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ firmware_vhd_pool_dir }}/{{ vm_name }}_VARS.fd"
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: delete the root vhd
|
- name: delete the root vhd
|
||||||
when: delete_root_vhd
|
when: delete_root_vhd
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
Loading…
Reference in New Issue
Block a user