# TypeError when using include

**URL:** <https://forum.ansible.com/t/typeerror-when-using-include/11454>\
**Category:** Ansible Project\
**Tags:** fedora\
**Created:** [April 26, 2012, 9:25am UTC](https://forum.ansible.com/t/typeerror-when-using-include/11454 "2012-04-26T09:25:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Duy\_Thang](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@Duy\_Thang](https://forum.ansible.com/u/Duy_Thang)\
**Post date:** [April 26, 2012, 9:25am UTC](https://forum.ansible.com/t/typeerror-when-using-include/11454/1 "2012-04-26T09:25:11Z")

</div>

Hi,

I’m newbie to ansible, and I have a problem when using include feature. I had a search in google and in mailinglist but cant find anything useful.  
This is my playbook.yml file:

> * * *
> 
> - hosts: mailservice  
> vars:  
> userdir: /data2/mailservice  
> user: root  
> tasks:
> - include: tasks/python-mail.yml
> - name: ensure mailservice directory exists  
> action: file path={{ userdir }} state=directory

And this is the content of file tasks/python-mail.yml:

> * * *
> 
> - name: install python  
> action: yum pkg=python state=installed

When I run the ansible-playbook command, it raise the error

> Traceback (most recent call last):  
> File “/usr/bin/ansible-playbook”, line 100, in   
> sys.exit(main(sys.argv[1:]))  
> File “/usr/bin/ansible-playbook”, line 77, in main  
> sudo\_pass=sudopass  
> File “/usr/lib/python2.7/site-packages/ansible/playbook.py”, line 104, in **init**  
> self.playbook = self.\_parse\_playbook(playbook)  
> File “/usr/lib/python2.7/site-packages/ansible/playbook.py”, line 192, in \_parse\_playbook  
> self.\_include\_tasks(play, task, dirname, new\_tasks)  
> File “/usr/lib/python2.7/site-packages/ansible/playbook.py”, line 157, in \_include\_tasks  
> included = utils.template\_from\_file(path, inject\_vars)  
> File “/usr/lib/python2.7/site-packages/ansible/utils.py”, line 255, in template\_from\_file  
> return template(data, vars)  
> TypeError: template() takes exactly 3 arguments (2 given)

It run ok if I comment out the include line. I’m using ansible version 0.3 on Fedora 16. Can you tell me what’s wrong with my config, or is it a bug? Thank you very much.

Regards,

---

<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:** [April 26, 2012, 12:07pm UTC](https://forum.ansible.com/t/typeerror-when-using-include/11454/2 "2012-04-26T12:07:15Z")

</div>

Pull the latest code on the master branch and this problem goes away.
