From 216962a98cb1420f1b0ea16a27c68dfecb5f9db8 Mon Sep 17 00:00:00 2001 From: Drew Brown Date: Thu, 6 Jul 2023 13:59:11 -0500 Subject: [PATCH] proxmox_kvm: Add required timeout arg when force deleting (#6827) * Add required timeout arg when force deleting * Add changelog fragment * Update changelogs/fragments/6827-proxmox_kvm-force-delete-bug-fix.yaml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- changelogs/fragments/6827-proxmox_kvm-force-delete-bug-fix.yaml | 2 ++ plugins/modules/proxmox_kvm.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/6827-proxmox_kvm-force-delete-bug-fix.yaml 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)