diff --git a/plugins/inventory/kheops.py b/plugins/inventory/kheops.py index 12d5928..5ee984e 100644 --- a/plugins/inventory/kheops.py +++ b/plugins/inventory/kheops.py @@ -86,6 +86,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable, Constructable): #self._consume_options(config_data) # Get options from inventory + self.jinja2_native = self.get_option('jinja2_native') self.strict = self.get_option('strict') self.compose = self.get_option('compose') self.groups = self.get_option('groups') @@ -111,6 +112,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable, Constructable): scope=None, _templar=self.templar, _variables=host.get_vars(), + jinja2_native=self.jinja2_native, #trace=True, #explain=True, ) diff --git a/plugins/plugin_utils/common.py b/plugins/plugin_utils/common.py index 126f48f..f22cf60 100644 --- a/plugins/plugin_utils/common.py +++ b/plugins/plugin_utils/common.py @@ -462,6 +462,7 @@ class AnsibleKheops(): _variables=None, _process_scope=None, _process_results=None, + jinja2_native=False ): _process_scope = _process_scope or self.config['process_scope'] @@ -471,7 +472,7 @@ class AnsibleKheops(): scope = self.get_scope_from_host_inventory(_variables, scope=scope) elif _process_scope == 'jinja': assert _templar, f"BUG: We expected a templar object here, got: {_templar}" - scope = self.get_scope_from_jinja(_variables, _templar, scope=scope) + scope = self.get_scope_from_jinja(_variables, _templar, scope=scope, jinja2_native=jinja2_native) ret = self.lookup(keys, namespace=namespace, scope=scope)