diff --git a/plugins/inventory/kubevirt.py b/plugins/inventory/kubevirt.py index 6f48ccf..76d8a69 100644 --- a/plugins/inventory/kubevirt.py +++ b/plugins/inventory/kubevirt.py @@ -604,6 +604,18 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): self.inventory.set_variable( 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: """