# adhoc template creation

**URL:** <https://forum.ansible.com/t/adhoc-template-creation/19627>\
**Category:** Ansible Project\
**Created:** [October 27, 2015, 2:07pm UTC](https://forum.ansible.com/t/adhoc-template-creation/19627 "2015-10-27T14:07:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Ogai](https://avatars.discourse-cdn.com/v4/letter/i/3e96dc/32.png) [@Ivan\_Ogai](https://forum.ansible.com/u/Ivan_Ogai)\
**Post date:** [October 27, 2015, 2:07pm UTC](https://forum.ansible.com/t/adhoc-template-creation/19627/1 "2015-10-27T14:07:50Z")

</div>

I just would like to locally compile a template, a simple adhoc operation. The error is _templates are only usable in playbooks_. The command:

`ansible localhost -c local -i localhost, -m template -a "src=settings.py.j2 dest=/tmp/settings.j2"`

---

<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:** [October 28, 2015, 1:14am UTC](https://forum.ansible.com/t/adhoc-template-creation/19627/2 "2015-10-28T01:14:33Z")

</div>

This was a intended restriction as adhoc did not gather facts and  
templates relying on them would fail.
