proxmox inventory - fix parsing for offline nodes (#2967) (#2984)

* Initial commit

* Adding changelog fragment

* Applying initial review suggestions

(cherry picked from commit 111c5de550)

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
This commit is contained in:
patchback[bot] 2021-07-10 16:56:01 +02:00 committed by GitHub
commit e3e25b60d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View file

@ -353,6 +353,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
if node['type'] == 'node':
self.inventory.add_child(nodes_group, node['node'])
if node['status'] == 'offline':
continue
# get node IP address
ip = self._get_node_ip(node['node'])
self.inventory.set_variable(node['node'], 'ansible_host', ip)