# Call Templar or Template from a Custom Plugin

**URL:** <https://forum.ansible.com/t/call-templar-or-template-from-a-custom-plugin/18204>\
**Category:** Ansible Developer\
**Created:** [May 11, 2015, 9:20pm UTC](https://forum.ansible.com/t/call-templar-or-template-from-a-custom-plugin/18204 "2015-05-11T21:20:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franklin\_Wise](https://avatars.discourse-cdn.com/v4/letter/f/8491ac/32.png) [@Franklin\_Wise](https://forum.ansible.com/u/Franklin_Wise)\
**Post date:** [May 11, 2015, 9:20pm UTC](https://forum.ansible.com/t/call-templar-or-template-from-a-custom-plugin/18204/1 "2015-05-11T21:20:53Z")

</div>

I’m writing a custom plugin and everything works great, except I’d like to use the built in Template task. However, if I’m unable to reference the template library correctly.

I’ve tried:

from ansible.plugins.action import ActionBase  
from ansible.utils import Template  
from ansible.template import Templar

I’ve tried:

template\_return = self.runner.\_execute\_module(conn, tmp, ‘template’, template\_args, inject=inject, complex\_args=complex\_args, persist\_files=True)

with no success.

Any input would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Henry\_Finucane](https://avatars.discourse-cdn.com/v4/letter/h/94ad74/32.png) [@Henry\_Finucane](https://forum.ansible.com/u/Henry_Finucane)\
**Post date:** [May 12, 2015, 11:58pm UTC](https://forum.ansible.com/t/call-templar-or-template-from-a-custom-plugin/18204/2 "2015-05-12T23:58:54Z")

</div>

You want to call out to the template action plugin, not the module.

I think synchronize has an example?
