From 177e327c24d740a96cc52e7cddbf79d3b75afa15 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 6 Jul 2023 21:37:15 +0200 Subject: [PATCH] [PR #6827/216962a9 backport][stable-6] proxmox_kvm: Add required timeout arg when force deleting (#6865) 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 (cherry picked from commit 216962a98cb1420f1b0ea16a27c68dfecb5f9db8) Co-authored-by: Drew Brown --- 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 fe55470443..73ebd8ba0d 100644 --- a/plugins/modules/proxmox_kvm.py +++ b/plugins/modules/proxmox_kvm.py @@ -1413,7 +1413,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)