customs list of paths for searching templates?

HI!

How can I specify a ordered custom list of paths where a template task looks for Jinja2 template files?

Ciao, Michael.

Hello Michael,

As i understand your query you want to use custom list of jinja2 template paths. you can use fileglob module here to match all the files of a particular pattern in a directory. This module return a list of paths.

Below is the example playbook:

Thanks for answering. Actually I'm already using with_fileglob. But I guess I want a nested combination of with_fileglob and with_first_found.

My attempts to feed the fileglob lookup result into with_first_found were not successful though.

Looking at ansible's Python source I got the impression that it might be possible to pass key-word arguments :paths: to the Python code from an ansible template task.

Ciao, Michael.