diff --git a/changelogs/fragments/6827-proxmox_kvm-force-delete-bug-fix.yaml b/changelogs/fragments/6827-proxmox_kvm-force-delete-bug-fix.yaml new file mode 100644 index 0000000000..24e012c513 --- /dev/null +++ b/changelogs/fragments/6827-proxmox_kvm-force-delete-bug-fix.yaml @@ -0,0 +1,2 @@ +bugfixes: + - proxmox_kvm - ``absent`` state with ``force`` specified failed to stop the VM due to the ``timeout`` value not being passed to ``stop_vm`` (https://github.com/ansible-collections/community.general/pull/6827). diff --git a/plugins/modules/proxmox_kvm.py b/plugins/modules/proxmox_kvm.py index 34827a8a8f..690ae5c750 100644 --- a/plugins/modules/proxmox_kvm.py +++ b/plugins/modules/proxmox_kvm.py @@ -1503,7 +1503,7 @@ def main(): status['status'] = vm['status'] if vm['status'] == 'running': if module.params['force']: - proxmox.stop_vm(vm, True) + proxmox.stop_vm(vm, True, timeout=module.params['timeout']) else: module.exit_json(changed=False, vmid=vmid, msg="VM %s is running. Stop it before deletion or use force=true." % vmid) taskid = proxmox_node.qemu.delete(vmid)