# .j2 extension for templates

**URL:** <https://forum.ansible.com/t/j2-extension-for-templates/12857>\
**Category:** Ansible Project\
**Created:** [May 23, 2013, 1:24pm UTC](https://forum.ansible.com/t/j2-extension-for-templates/12857 "2013-05-23T13:24:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seb.stark](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@seb.stark](https://forum.ansible.com/u/seb.stark)\
**Post date:** [May 23, 2013, 1:24pm UTC](https://forum.ansible.com/t/j2-extension-for-templates/12857/1 "2013-05-23T13:24:49Z")

</div>

Hi,

is there any other reason besides recognizability I should append .j2 to templates? I am not sure yet wether in the long run this could turn into some kind of problem if the suffix is omitted.

Sebastian

---

<div class="post-metadata">

**Author:** ![Lorin\_Hochstein1](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@Lorin\_Hochstein1](https://forum.ansible.com/u/Lorin_Hochstein1)\
**Post date:** [May 23, 2013, 1:28pm UTC](https://forum.ansible.com/t/j2-extension-for-templates/12857/2 "2013-05-23T13:28:39Z")

</div>

Hi Sebastian:

No, there’s no other reason to append .j2 to templates. I never do so, since I put templates and files in separate directories (and the new “roles” feature encourages organizing files vs. templates by directory).

Take care,

Lorin

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [May 23, 2013, 1:43pm UTC](https://forum.ansible.com/t/j2-extension-for-templates/12857/3 "2013-05-23T13:43:20Z")

</div>

Correct.

It’s just a convention to make it clear something is a template when looking at the filename.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [May 23, 2013, 1:47pm UTC](https://forum.ansible.com/t/j2-extension-for-templates/12857/4 "2013-05-23T13:47:36Z")

</div>

Ans for those that want editor highlighting and lazily do this by extension.

Brian Coca
