diff --git a/changelogs/fragments/10155-proxmox-bugfix.yml b/changelogs/fragments/10155-proxmox-bugfix.yml new file mode 100644 index 0000000000..79dacc4602 --- /dev/null +++ b/changelogs/fragments/10155-proxmox-bugfix.yml @@ -0,0 +1,2 @@ +bugfixes: + - "proxmox - fix crash in module when the used on an existing LXC container with ``state=present`` and ``force=true`` (https://github.com/ansible-collections/community.proxmox/pull/91, https://github.com/ansible-collections/community.general/pull/10155)." diff --git a/plugins/modules/proxmox.py b/plugins/modules/proxmox.py index 9dd4b13d5c..dda424910f 100644 --- a/plugins/modules/proxmox.py +++ b/plugins/modules/proxmox.py @@ -890,6 +890,7 @@ class ProxmoxLxcAnsible(ProxmoxAnsible): self.module.exit_json( changed=False, vmid=vmid, msg="VM %s already exists." % identifier ) + identifier = self.format_vm_identifier(vmid, lxc["name"]) self.module.debug( "VM %s already exists, but we don't update and instead forcefully recreate it." % identifier