Would there be any interest in a mako module, as an alternative to the template module?
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
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
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.
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.