# Module within role (library) not found/executed

**URL:** <https://forum.ansible.com/t/module-within-role-library-not-found-executed/22008>\
**Category:** Ansible Project\
**Created:** [July 13, 2016, 12:43pm UTC](https://forum.ansible.com/t/module-within-role-library-not-found-executed/22008 "2016-07-13T12:43:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sirk\_Johannsen](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Sirk\_Johannsen](https://forum.ansible.com/u/Sirk_Johannsen)\
**Post date:** [July 13, 2016, 12:43pm UTC](https://forum.ansible.com/t/module-within-role-library-not-found-executed/22008/1 "2016-07-13T12:43:43Z")

</div>

Hi all,

Ansible Version 2.1.0 installed via pip

I have a strange problem with a module in a roles library path.  
This is the structure:

`  
roles/elasticsearch/  
roles/elasticsearch/library/  
roles/elasticsearch/library/elasticsearch\_plugin.py

`

If I execute

`  
ansible-playbook playbooks/elasticsearch/cluster.yml

`

which basically just sets some variables and includes the above role.

I get

`

failed: [elasticsearch-node] (item={u’version’: u’master’, u’name’: u’kopf’, u’plugin’: u’lmenezes/elasticsearch-kopf’}) =\> {“failed”: true, “invocation”: {“module\_args”: {“conf\_dir”: “/etc/elasticsearch/node1”, “es\_home”: “/usr/share/elasticsearch”, “instance\_default\_file”: “/etc/default/node1\_elasticsearch”, “name”: “kopf”, “plugin”: “lmenezes/elasticsearch-kopf”, “state”: “present”, “version”: “master”}, “module\_name”: “elasticsearch\_plugin”}, “item”: {“name”: “kopf”, “plugin”: “lmenezes/elasticsearch-kopf”, “version”: “master”}, “msg”: “unsupported parameter for module: instance\_default\_file”}

`

So

`  
“msg”: “unsupported parameter for module: instance\_default\_file”

`

is the error here. Which is very misleading. Cause in reality it does not find the module.

Now, If I specify a module path OR put the module in the “library” directory of the playbook it works !!!

`ansible-playbook playbooks/elasticsearch/cluster.yml -M roles/elasticsearch/library/`

Output:

`

ok: [elasticsearch-node] =\> (item={u’version’: u’master’, u’name’: u’kopf’, u’plugin’: u’lmenezes/elasticsearch-kopf’}) =\> {“changed”: false, “command”: “/usr/share/elasticsearch/bin/plugin list | grep – ‘- kopf$’”, “invocation”: {“module\_args”: {“conf\_dir”: “/etc/elasticsearch/node1”, “es\_home”: “/usr/share/elasticsearch”, “instance\_default\_file”: “/etc/default/node1\_elasticsearch”, “name”: “kopf”, “plugin”: “lmenezes/elasticsearch-kopf”, “state”: “present”, “version”: “master”}, “module\_name”: “elasticsearch\_plugin”}, “item”: {“name”: “kopf”, “plugin”: “lmenezes/elasticsearch-kopf”, “version”: “master”}, “output”: " - kopf\n : ", “returncode”: 0, “success”: true}

`

Help would be very appreciated !

Sirk

---

<div class="post-metadata">

**Author:** ![sirk.johannsen](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@sirk.johannsen](https://forum.ansible.com/u/sirk.johannsen)\
**Post date:** [July 13, 2016, 1:59pm UTC](https://forum.ansible.com/t/module-within-role-library-not-found-executed/22008/2 "2016-07-13T13:59:08Z")

</div>

The problem was that in ansible-extra-modules a module called “elasticsearch\_plugin” already exists !  
So renaming my module to “es\_plugin” solved the problem.
