# Organize the template directory within the roles folder

**URL:** <https://forum.ansible.com/t/organize-the-template-directory-within-the-roles-folder/16551>\
**Category:** Ansible Project\
**Created:** [October 19, 2014, 11:02am UTC](https://forum.ansible.com/t/organize-the-template-directory-within-the-roles-folder/16551 "2014-10-19T11:02:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajay\_Divakaran](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Ajay\_Divakaran](https://forum.ansible.com/u/Ajay_Divakaran)\
**Post date:** [October 19, 2014, 11:02am UTC](https://forum.ansible.com/t/organize-the-template-directory-within-the-roles-folder/16551/1 "2014-10-19T11:02:12Z")

</div>

Hi all,

According to the documentation the template files should sit in the top directory of the templates folder for a given role. Does Ansible recognize the template files if the template directory is organized into sub folders?

e.g

roles  
x  
templates  
folder1  
template1.j2  
folder2  
template2.js

usage of template module in task for role x

template: src=/folder1/template1.js dest=/opt/foo

---

<div class="post-metadata">

**Author:** ![Michael\_Peters](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Michael\_Peters](https://forum.ansible.com/u/Michael_Peters)\
**Post date:** [October 22, 2014, 8:15pm UTC](https://forum.ansible.com/t/organize-the-template-directory-within-the-roles-folder/16551/2 "2014-10-22T20:15:44Z")

</div>

It does, but the path is relative, not absolute. Try (notice missing  
"/" prefix on src):

&nbsp;&nbsp;template: src=folder1/template1.js dest=/opt/foo
