# lookup('template') looks in files/ not templates/ ?

**URL:** <https://forum.ansible.com/t/lookup-template-looks-in-files-not-templates/18354>\
**Category:** Ansible Project\
**Created:** [May 31, 2015, 3:49am UTC](https://forum.ansible.com/t/lookup-template-looks-in-files-not-templates/18354 "2015-05-31T03:49:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barry\_Kaplan](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@Barry\_Kaplan](https://forum.ansible.com/u/Barry_Kaplan)\
**Post date:** [May 31, 2015, 3:49am UTC](https://forum.ansible.com/t/lookup-template-looks-in-files-not-templates/18354/1 "2015-05-31T03:49:13Z")

</div>

I see that lookup(‘template’) is looking in the files directory not the template directory.

`  
fatal: [10.0.139.56] =\> Failed to template msg=“{{lookup(‘template’, ‘rs\_initiate\_cmd.js.j2’)}}”: unable to read /Users/bkaplan/si/ops/ansible/playbooks/roles/mongodb/files/rs\_initiate\_cmd.js.j2

`

Is this expected or a bug? I can’t find any docs on lookup(‘template’) only the example in the Lookups section. (Have not looked at the code yet.)

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [May 31, 2015, 1:49pm UTC](https://forum.ansible.com/t/lookup-template-looks-in-files-not-templates/18354/2 "2015-05-31T13:49:16Z")

</div>

It is expected.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 1, 2015, 1:09pm UTC](https://forum.ansible.com/t/lookup-template-looks-in-files-not-templates/18354/3 "2015-06-01T13:09:09Z")

</div>

All lookups use files/, I agree this is confusing with template and  
would contemplate adding the templates/ directories for this specific  
plugin.
