diff --git a/multi-node-aio/playbooks/deploy-vms.yml b/multi-node-aio/playbooks/deploy-vms.yml index 3ddfeee8..d6063c7b 100644 --- a/multi-node-aio/playbooks/deploy-vms.yml +++ b/multi-node-aio/playbooks/deploy-vms.yml @@ -45,16 +45,14 @@ failed_when: false when: - hostvars[item]['server_vm'] | default(false) | bool - - default_vm_disk_mode | default('lvm') == "lvm" with_items: "{{ groups['pxe_servers'] }}" - name: Delete VM Disk Image - command: | - rm -f /var/lib/libvirt/images/{{ hostvars[item]['server_hostname'] }}.img - failed_when: false + file: + path: "/var/lib/libvirt/images/{{ hostvars[item]['server_hostname'] }}.img" + state: absent when: - hostvars[item]['server_vm'] | default(false) | bool - - default_vm_disk_mode | default('lvm') == "file" with_items: "{{ groups['pxe_servers'] }}" - name: Create VM LV