# ansible/test-module  produces this result:  modify\_module() got multiple values for keyword argument 'task\_vars'

**URL:** <https://forum.ansible.com/t/ansible-test-module-produces-this-result-modify-module-got-multiple-values-for-keyword-argument-task-vars/27294>\
**Category:** Ansible Project\
**Created:** [April 16, 2018, 6:55pm UTC](https://forum.ansible.com/t/ansible-test-module-produces-this-result-modify-module-got-multiple-values-for-keyword-argument-task-vars/27294 "2018-04-16T18:55:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sessyemo](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@sessyemo](https://forum.ansible.com/u/sessyemo)\
**Post date:** [April 16, 2018, 6:55pm UTC](https://forum.ansible.com/t/ansible-test-module-produces-this-result-modify-module-got-multiple-values-for-keyword-argument-task-vars/27294/1 "2018-04-16T18:55:41Z")

</div>

I used the test-module script to debug modules in ansible but i am getting a strange error:

1 Here is the example i followed:  
[https://ansible-manual.readthedocs.io/en/stable-2.2/developing\_modules.html](https://ansible-manual.readthedocs.io/en/stable-2.2/developing_modules.html)

1. 

So i executed this command

ansible/hacking/test-module -I ansible\_python\_interpreter=/usr/bin/python -m ./custom\_modules/timetest.py

**BUT I am getting this error :**

[vagrant@db3 vagrant]$ ansible/hacking/test-module -I ansible\_python\_interpreter=/usr/bin/python -m ./custom\_modules/timetest.py  
Traceback (most recent call last):  
File “ansible/hacking/test-module”, line 270, in   
main()  
File “ansible/hacking/test-module”, line 251, in main  
(modfile, modname, module\_style) = boilerplate\_module(options.module\_path, options.module\_args, interpreters, options.check, options.filename)  
File “ansible/hacking/test-module”, line 154, in boilerplate\_module  
task\_vars=task\_vars  
TypeError: modify\_module() got multiple values for keyword argument ‘task\_vars’

**Here is details my ansible**

[vagrant@db3 vagrant]$ ansible --version  
ansible 2.5.0  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/home/vagrant/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/site-packages/ansible  
executable location = /usr/bin/ansible  
python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

When i checked the modify\_module function in module\_common.py i see that task\_vars is in position 4

```auto
def modify_module(module_name, module_path, module_args, task_vars=None, templar=None, module_compression='ZIP_STORED', async_timeout=0, become=False,
                  become_method=None, become_user=None, become_password=None, become_flags=None, environment=None):

```

**but when it is used in the test-module it is not on position 4 but Templar is:**

(module\_data, module\_style, shebang) = module\_common.modify\_module(  
modname,  
modfile,  
complex\_args,  
Templar(loader=loader),  
task\_vars=task\_vars  
)

**Please is this a bug? and if it is, how to make this work?**

**Regards,**  
**Sessy**
