mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
* proxmox_kvm - state:template will check if template exists first (#7791) * added changelog entry * Update changelog fragment. --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- proxmox_kvm - running ``state=template`` will first check whether VM is already a template (https://github.com/ansible-collections/community.general/pull/7792).
|
||||||
@@ -1556,6 +1556,9 @@ def main():
|
|||||||
try:
|
try:
|
||||||
vm = proxmox.get_vm(vmid)
|
vm = proxmox.get_vm(vmid)
|
||||||
|
|
||||||
|
if vm['template'] == 1:
|
||||||
|
module.exit_json(changed=False, vmid=vmid, msg="VM %s is already a template" % vmid, **status)
|
||||||
|
|
||||||
if proxmox.convert_to_template(vm, force=module.params['force'], timeout=module.params['timeout']):
|
if proxmox.convert_to_template(vm, force=module.params['force'], timeout=module.params['timeout']):
|
||||||
module.exit_json(changed=True, vmid=vmid, msg="VM %s is converting to template" % vmid, **status)
|
module.exit_json(changed=True, vmid=vmid, msg="VM %s is converting to template" % vmid, **status)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user