* don't add args if set to 'no_defaults'
* never add force even if false, will require archive parameter other which is not implemented
* remove trailing whitespace
* add changelog fragment
* Update changelogs/fragments/1783-proxmox-kvm-fix-args-500-error.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5aac81bdd1
)
Co-authored-by: almdudler777 <43605831+almdudler777@users.noreply.github.com>
pull/1834/head
parent
26d7c28b33
commit
bd61228e40
|
@ -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).
|
|
@ -31,6 +31,9 @@ options:
|
||||||
description:
|
description:
|
||||||
- Pass arbitrary arguments to kvm.
|
- Pass arbitrary arguments to kvm.
|
||||||
- This option is for experts only!
|
- 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/<vmid>.serial,server,nowait).
|
||||||
|
Note that the default value of I(proxmox_default_behavior) changes in community.general 4.0.0.
|
||||||
type: str
|
type: str
|
||||||
autostart:
|
autostart:
|
||||||
description:
|
description:
|
||||||
|
@ -925,9 +928,9 @@ def create_vm(module, proxmox, vmid, newid, node, name, memory, cpu, cores, sock
|
||||||
if searchdomains:
|
if searchdomains:
|
||||||
kwargs['searchdomain'] = ' '.join(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 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
|
kwargs['args'] = vm_args
|
||||||
elif module.params['api_user'] == "root@pam" and module.params['args'] is not None:
|
elif module.params['api_user'] == "root@pam" and module.params['args'] is not None:
|
||||||
kwargs['args'] = module.params['args']
|
kwargs['args'] = module.params['args']
|
||||||
|
@ -1118,7 +1121,6 @@ def main():
|
||||||
cores=1,
|
cores=1,
|
||||||
cpu='kvm64',
|
cpu='kvm64',
|
||||||
cpuunits=1000,
|
cpuunits=1000,
|
||||||
force=False,
|
|
||||||
format='qcow2',
|
format='qcow2',
|
||||||
kvm=True,
|
kvm=True,
|
||||||
memory=512,
|
memory=512,
|
||||||
|
|
Loading…
Reference in New Issue