mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* 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>
This commit is contained in:
parent
ae2acef507
commit
a5117bdeff
2 changed files with 8 additions and 3 deletions
|
@ -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:
|
||||
- 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/<vmid>.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,
|
||||
|
|
Loading…
Reference in a new issue