Closed
Description
Summary
Cloning fails with cryptic arrors. Actually at a lof of places, some due to proxmoxer but some not. This is one of such places.
I am not sure what the original idea was, but this lacks error checking whatever it was:
--- /usr/lib/python3/dist-packages/ansible_collections/community/general/plugins/modules/cloud/misc/proxmox.py~ 2022-10-15 16:33:33.000000000 +0200
+++ /usr/lib/python3/dist-packages/ansible_collections/community/general/plugins/modules/cloud/misc/proxmox.py 2022-10-15 16:37:44.390779428 +0200
@@ -412,7 +412,9 @@
"""Check if the specified container is a template."""
proxmox_node = self.proxmox_api.nodes(node)
config = getattr(proxmox_node, VZ_TYPE)(vmid).config.get()
+ if 'template' in config:
+ return config['template']
+ return False
- return config['template']
def create_instance(self, vmid, node, disk, storage, cpus, memory, swap, timeout, clone, **kwargs):
Chokes when config doesn't contain "template". I left to the reader to determine when this happens.
Issue Type
Bug Report
Component Name
/usr/lib/python3/dist-packages/ansible_collections/community/general/plugins/modules/cloud/misc/proxmox.py
Ansible Version
ansible [core 2.13.4]
Community.general Version
community.general 5.6.0
Configuration
No response
OS / Environment
No response
Steps to Reproduce
configure/clone various PVE versions, observe some of the fail.
Expected Results
- error checking
- non-cryptic error messages (both API HTTP and data responses)
Actual Results
Haphazard results and lot of guesswork at configs.
Code of Conduct
- I agree to follow the Ansible Code of Conduct
Activity