1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[PR #6641/1f6d404d backport][stable-7] Proxmox inventory plugin: support composite variables (#6684)

Proxmox inventory plugin: support composite variables (#6641)

* Added composite var support for proxmox inventory plugin

* Composite variables support for Proxmox nodes in dynamic inventory plugin
Fixes #6640

* Composite variables support for Proxmox nodes in dynamic inventory plugin
Fixes #6640

* Added composite var support for proxmox inventory plugin

* Added composite var support for proxmox inventory plugin

* Update changelogs/fragments/6640-proxmox-composite-variables-support.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 1f6d404deb)

Co-authored-by: Paul Levytskyi <25350788+levytskyip@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2023-06-12 22:11:09 +02:00 committed by GitHub
parent 7b0890c98f
commit 3b24363383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,3 @@
---
minor_changes:
- proxmox inventory plugin - add composite variables support for Proxmox nodes (https://github.com/ansible-collections/community.general/issues/6640).

View file

@ -590,6 +590,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
ip = self._get_node_ip(node['node']) ip = self._get_node_ip(node['node'])
self.inventory.set_variable(node['node'], 'ansible_host', ip) self.inventory.set_variable(node['node'], 'ansible_host', ip)
# Setting composite variables
variables = self.inventory.get_host(node['node']).get_vars()
self._set_composite_vars(self.get_option('compose'), variables, node['node'], strict=self.strict)
# add LXC/Qemu groups for the node # add LXC/Qemu groups for the node
for ittype in ('lxc', 'qemu'): for ittype in ('lxc', 'qemu'):
node_type_group = self._group('%s_%s' % (node['node'], ittype)) node_type_group = self._group('%s_%s' % (node['node'], ittype))