mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-03-26 19:03:16 +00:00
Merge pull request #77 from l3acon/add-composite-vars
fix: add composite vars to inventory
This commit is contained in:
@@ -605,6 +605,18 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||||||
self.inventory.set_variable(
|
self.inventory.set_variable(
|
||||||
vmi_name, "vmi_volume_status", vmi_volume_status
|
vmi_name, "vmi_volume_status", vmi_volume_status
|
||||||
)
|
)
|
||||||
|
self.set_composable_vars(vmi_name)
|
||||||
|
|
||||||
|
def set_composable_vars(self, vmi_name):
|
||||||
|
"""
|
||||||
|
set_composable_vars sets vars per
|
||||||
|
https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html
|
||||||
|
"""
|
||||||
|
host_vars = self.inventory.get_host(vmi_name).get_vars()
|
||||||
|
strict = self.get_option("strict")
|
||||||
|
self._set_composite_vars(self.get_option("compose"), host_vars, vmi_name, strict=True)
|
||||||
|
self._add_host_to_composed_groups(self.get_option("groups"), host_vars, vmi_name, strict=strict)
|
||||||
|
self._add_host_to_keyed_groups(self.get_option("keyed_groups"), host_vars, vmi_name, strict=strict)
|
||||||
|
|
||||||
def get_ssh_services_for_namespace(self, client: K8SClient, namespace: str) -> Dict:
|
def get_ssh_services_for_namespace(self, client: K8SClient, namespace: str) -> Dict:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user