diff --git a/changelogs/fragments/1991-proxmox-inventory-fix-template-in-pool.yml b/changelogs/fragments/1991-proxmox-inventory-fix-template-in-pool.yml new file mode 100644 index 0000000000..90a438dddf --- /dev/null +++ b/changelogs/fragments/1991-proxmox-inventory-fix-template-in-pool.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - proxmox inventory - exclude qemu templates from inclusion to the inventory via pools (https://github.com/ansible-collections/community.general/issues/1986, https://github.com/ansible-collections/community.general/pull/1991). diff --git a/plugins/inventory/proxmox.py b/plugins/inventory/proxmox.py index 428e58a703..59f608c762 100644 --- a/plugins/inventory/proxmox.py +++ b/plugins/inventory/proxmox.py @@ -325,7 +325,8 @@ class InventoryModule(BaseInventoryPlugin, Cacheable): for member in self._get_members_per_pool(pool['poolid']): if member.get('name'): - self.inventory.add_child(pool_group, member['name']) + if not member.get('template'): + self.inventory.add_child(pool_group, member['name']) def parse(self, inventory, loader, path, cache=True): if not HAS_REQUESTS: