# mako

**URL:** <https://forum.ansible.com/t/mako/12255>\
**Category:** Ansible Project\
**Created:** [January 28, 2013, 1:21am UTC](https://forum.ansible.com/t/mako/12255 "2013-01-28T01:21:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [January 28, 2013, 1:21am UTC](https://forum.ansible.com/t/mako/12255/1 "2013-01-28T01:21:02Z")

</div>

Would there be any interest in a mako module, as an alternative to the template module?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [January 28, 2013, 1:37am UTC](https://forum.ansible.com/t/mako/12255/2 "2013-01-28T01:37:29Z")

</div>

I am totally fine with this, and love the idea -- as it allows people  
to use engines they are more comfortable with. Here is how it needs  
to happen though.

I would really like it if the template module could support multiple  
engines intelligently though rather than having multiple modules.

See [https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/action\_plugins/template.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/action_plugins/template.py)

We should not have to modify that file at all. Changes should affect

[https://github.com/ansible/ansible/blob/devel/lib/ansible/utils/template.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/utils/template.py)

How might it work? So if the first line of the template is:

#engine=mako

(or some other module that also exists)

it would override the default and strip this line out of the template.  
&nbsp;&nbsp;&nbsp;The default is template\_engine in the config file or  
ANSIBLE\_TEMPLATE\_ENGINE and it defaults to "Jinja2"

Thus you could set it in any template file, or set it globally, either way.

We should only import mako if it's trying to get used, so as to not  
add dependencies.

This work really needs to happen in here, and have the concept of a  
'template' module, just like our other module series.

We could ship with both, but it wouldn't load the actual dependencies  
unless one of the template modules was actually used.

This also allows us to clean up the ansible/utils/template.py somewhat  
which would be good.

I'd wait on Daniel's input though as he had a basedir change in  
progress (I think) that we want to get in first.
