Skip to content

Commit 29f412e

Browse files
authored
Fix #123 (#124)
* fix #123 * add changelog * fix * fix line ending
1 parent c3798af commit 29f412e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
minor_changes:
3+
- "proxmox inventory plugin - always provide basic information regardless of want_facts (https://github.com/ansible-collections/community.proxmox/pull/124)."

plugins/inventory/proxmox.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,6 @@ def _get_agent_network_interfaces(self, node, vmid, vmtype):
429429
def _get_vm_config(self, properties, node, vmid, vmtype, name):
430430
ret = self._get_json(f"{self.proxmox_url}/api2/json/nodes/{node}/{vmtype}/{vmid}/config")
431431

432-
properties[self._fact('node')] = node
433-
properties[self._fact('vmid')] = vmid
434-
properties[self._fact('vmtype')] = vmtype
435-
436432
plaintext_configs = [
437433
'description',
438434
]
@@ -551,6 +547,10 @@ def _handle_item(self, node, ittype, item):
551547
properties = dict()
552548
name, vmid = item['name'], item['vmid']
553549

550+
properties[self._fact('node')] = node
551+
properties[self._fact('vmid')] = vmid
552+
properties[self._fact('vmtype')] = ittype
553+
554554
# get status, config and snapshots if want_facts == True
555555
want_facts = self.get_option('want_facts')
556556
if want_facts:

0 commit comments

Comments
 (0)