* add a couple conditionals to make sure updating can be done with vmid only
* add changelog to PR
* replace conditional with any
* any takes list
* fix next conditional
* Update changelogs/fragments/5206-proxmox-conditional-vmid.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* capitalize VM and remove conditional for name requirement upon creation
* Fix URL destroyed by GitHub.
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Yvan E. Watchman <git@yvanwatchman.eu>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
(cherry picked from commit 19e4b7d3ab
)
Co-authored-by: Yvan Watchman <ik@yvanwatchman.eu>
pull/5292/head
parent
2e781bf8c4
commit
cdbcf8abc7
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
bugfixes:
|
||||
- proxmox_kvm - replace new condition with proper condition to allow for using ``vmid`` on update (https://github.com/ansible-collections/community.general/pull/5206).
|
|
@ -1243,8 +1243,10 @@ def main():
|
|||
module.exit_json(changed=False, vmid=vmid, msg="VM with vmid <%s> already exists" % vmid)
|
||||
elif proxmox.get_vmid(name, ignore_missing=True) and not (update or clone):
|
||||
module.exit_json(changed=False, vmid=proxmox.get_vmid(name), msg="VM with name <%s> already exists" % name)
|
||||
elif (not node) or (not name):
|
||||
module.fail_json(msg='node, name is mandatory for creating/updating vm')
|
||||
elif not node:
|
||||
module.fail.json(msg='node is mandatory for creating/updating VM')
|
||||
elif update and not any([vmid, name]):
|
||||
module.fail_json(msg='vmid or name is mandatory for updating VM')
|
||||
elif not proxmox.get_node(node):
|
||||
module.fail_json(msg="node '%s' does not exist in cluster" % node)
|
||||
|
||||
|
|
Loading…
Reference in New Issue