diff --git a/changelogs/fragments/1783-proxmox-kvm-fix-args-500-error.yaml b/changelogs/fragments/1783-proxmox-kvm-fix-args-500-error.yaml new file mode 100644 index 0000000000..5e46b066a8 --- /dev/null +++ b/changelogs/fragments/1783-proxmox-kvm-fix-args-500-error.yaml @@ -0,0 +1,3 @@ +bugfixes: + - proxmox_kvm - do not add ``args`` if ``proxmox_default_behavior`` is set to no_defaults (https://github.com/ansible-collections/community.general/issues/1641). + - proxmox_kvm - stop implicitly adding ``force`` equal to ``false``. Proxmox API requires not implemented parameters otherwise, and assumes ``force`` to be ``false`` by default anyways (https://github.com/ansible-collections/community.general/pull/1783). diff --git a/plugins/modules/cloud/misc/proxmox_kvm.py b/plugins/modules/cloud/misc/proxmox_kvm.py index 9db3f00eba..cf79e6553b 100644 --- a/plugins/modules/cloud/misc/proxmox_kvm.py +++ b/plugins/modules/cloud/misc/proxmox_kvm.py @@ -31,6 +31,9 @@ options: description: - Pass arbitrary arguments to kvm. - This option is for experts only! + - If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this + option has a default of C(-serial unix:/var/run/qemu-server/.serial,server,nowait). + Note that the default value of I(proxmox_default_behavior) changes in community.general 4.0.0. type: str api_host: description: @@ -969,9 +972,9 @@ def create_vm(module, proxmox, vmid, newid, node, name, memory, cpu, cores, sock if searchdomains: kwargs['searchdomain'] = ' '.join(searchdomains) - # -args and skiplock require root@pam user + # -args and skiplock require root@pam user - but can not use api tokens if module.params['api_user'] == "root@pam" and module.params['args'] is None: - if not update: + if not update and module.params['proxmox_default_behavior'] == 'compatibility': kwargs['args'] = vm_args elif module.params['api_user'] == "root@pam" and module.params['args'] is not None: kwargs['args'] = module.params['args'] @@ -1162,7 +1165,6 @@ def main(): cores=1, cpu='kvm64', cpuunits=1000, - force=False, format='qcow2', kvm=True, memory=512,