# customs list of paths for searching templates?

**URL:** <https://forum.ansible.com/t/customs-list-of-paths-for-searching-templates/31288>\
**Category:** Ansible Project\
**Created:** [September 16, 2019, 4:47pm UTC](https://forum.ansible.com/t/customs-list-of-paths-for-searching-templates/31288 "2019-09-16T16:47:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [September 16, 2019, 4:47pm UTC](https://forum.ansible.com/t/customs-list-of-paths-for-searching-templates/31288/1 "2019-09-16T16:47:42Z")

</div>

HI!

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

Ciao, Michael.

---

<div class="post-metadata">

**Author:** ![Soniya\_panwar](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@Soniya\_panwar](https://forum.ansible.com/u/Soniya_panwar)\
**Post date:** [September 17, 2019, 7:09am UTC](https://forum.ansible.com/t/customs-list-of-paths-for-searching-templates/31288/2 "2019-09-17T07:09:17Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [September 18, 2019, 4:14pm UTC](https://forum.ansible.com/t/customs-list-of-paths-for-searching-templates/31288/3 "2019-09-18T16:14:27Z")

</div>

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.
