diff --git a/changelogs/fragments/3052_proxmox_inventory_plugin.yml b/changelogs/fragments/3052_proxmox_inventory_plugin.yml new file mode 100644 index 0000000000..dfd4dddea9 --- /dev/null +++ b/changelogs/fragments/3052_proxmox_inventory_plugin.yml @@ -0,0 +1,2 @@ +bugfixes: + - proxmox inventory plugin - fixed plugin failure when a ``qemu`` guest has no ``template`` key (https://github.com/ansible-collections/community.general/pull/3052). diff --git a/plugins/inventory/proxmox.py b/plugins/inventory/proxmox.py index f0f5a4e418..33a564f333 100644 --- a/plugins/inventory/proxmox.py +++ b/plugins/inventory/proxmox.py @@ -413,7 +413,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): node_qemu_group = self.to_safe('%s%s' % (self.get_option('group_prefix'), ('%s_qemu' % node['node']).lower())) self.inventory.add_group(node_qemu_group) for qemu in self._get_qemu_per_node(node['node']): - if qemu['template']: + if qemu.get('template'): continue self.inventory.add_host(qemu['name'])