mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #6827/216962a9 backport][stable-7] proxmox_kvm: Add required timeout arg when force deleting (#6866)
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 <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 216962a98c
)
Co-authored-by: Drew Brown <drew@drewburr.com>
This commit is contained in:
parent
c1536a3501
commit
abd2a85709
2 changed files with 3 additions and 1 deletions
|
@ -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).
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue