# Test Jinja Template locally

**URL:** <https://forum.ansible.com/t/test-jinja-template-locally/14112>\
**Category:** Ansible Project\
**Created:** [December 10, 2013, 10:39am UTC](https://forum.ansible.com/t/test-jinja-template-locally/14112 "2013-12-10T10:39:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Patermann](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marc\_Patermann](https://forum.ansible.com/u/Marc_Patermann)\
**Post date:** [December 10, 2013, 10:39am UTC](https://forum.ansible.com/t/test-jinja-template-locally/14112/1 "2013-12-10T10:39:10Z")

</div>

Hi,

I never did anything with Jinja before, now I want to create my first template. 🙂

Is there an easy way to test my template locally?

Like on the command line with the variable as options?

i.e.  
# jinja-test mytemplate.js special=yes proxy=foo

# cat mytemplate.js  
proxy={{ proxy }}  
{% if special=yes %}  
&nbsp;&nbsp;&nbsp;bla bla  
{% endif %}

Marc

---

<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:** [December 10, 2013, 1:09pm UTC](https://forum.ansible.com/t/test-jinja-template-locally/14112/2 "2013-12-10T13:09:33Z")

</div>

just use local\_action: template, with the playbook and save it to a tmp dir, then you can examine it.

also --check and --diff do a good job of showing you what you would put into place with template module.
