--- - name: Stop VM before deletion (if running) no_log: true # defence in depth: the module already masks the API token secret delegate_to: "{{ pve_vm_delegate }}" community.proxmox.proxmox_kvm: node: "{{ pve_vm_node }}" vmid: "{{ pve_vm_vmid }}" state: stopped when: - pve_vm_exists - not ansible_check_mode - name: Delete VM no_log: true # defence in depth: the module already masks the API token secret delegate_to: "{{ pve_vm_delegate }}" community.proxmox.proxmox_kvm: node: "{{ pve_vm_node }}" vmid: "{{ pve_vm_vmid }}" state: absent when: - pve_vm_exists - not ansible_check_mode register: __pve_vm_delete