I’d like to read in a directory full of var files without having to specify individual files.
The below combination of lookup and split is valid to define a variable but appears not to be supported with vars_files with“ERROR! vars file { was not found on the Ansible Controller.”
I see in manager.py that the template is applied only individually per vars_files item and not at the top level so it’s not possible to assign a list structure directly to vars_files.
Thank you for a quick response Kai. For various reasons, we require the variables early on before the tasks stage and can’t take advantage of the wonderfully flexible include_vars.
but I am getting the same error. Did you manage to find a workaround?
For me the include_vars module is not an option, since I also need to evaluate the “{{…}}” inside the included files. Unfortunately, there is no import_vars module…
I will be also grateful for any tips. My ultimate goal is load variables from a bunch of files using glob or regex pattern, and evaluate {{}} inside them.