# Adding a new module location

**URL:** <https://forum.ansible.com/t/adding-a-new-module-location/15801>\
**Category:** Ansible Project\
**Created:** [July 29, 2014, 1:30pm UTC](https://forum.ansible.com/t/adding-a-new-module-location/15801 "2014-07-29T13:30:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mzp45](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@Mzp45](https://forum.ansible.com/u/Mzp45)\
**Post date:** [July 29, 2014, 1:30pm UTC](https://forum.ansible.com/t/adding-a-new-module-location/15801/1 "2014-07-29T13:30:07Z")

</div>

Hi,  
The default location for ansible modules is /usr/share/ansible. Is there a way to append another location to this one. In the .cfg I only see the option to replace the default.

Thanks

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 29, 2014, 1:35pm UTC](https://forum.ansible.com/t/adding-a-new-module-location/15801/2 "2014-07-29T13:35:03Z")

</div>

You can specify multiple paths seperated by colons.

Please do continue to leave the default in there at the head of the list.

---

<div class="post-metadata">

**Author:** ![Mzp45](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@Mzp45](https://forum.ansible.com/u/Mzp45)\
**Post date:** [July 29, 2014, 2:17pm UTC](https://forum.ansible.com/t/adding-a-new-module-location/15801/3 "2014-07-29T14:17:07Z")

</div>

I still get the following error  
ERROR: custom\_module is not a legal parameter in an Ansible task or handler.

custom\_module is a simple module i wrote to do some tests. It works fine when its in /usr/share/ansible but fails when i remove it from there and put in a specific module directory.

This is the line in /etc/asnible/ansible.cfg

library = /usr/share/ansible:/path/to/custom/module

I’m running ansible 1.6.2

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [July 29, 2014, 2:41pm UTC](https://forum.ansible.com/t/adding-a-new-module-location/15801/4 "2014-07-29T14:41:50Z")

</div>

​AFAIK you need to point to the directory, not the module itself?​

---

<div class="post-metadata">

**Author:** ![Mzp45](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@Mzp45](https://forum.ansible.com/u/Mzp45)\
**Post date:** [July 29, 2014, 2:44pm UTC](https://forum.ansible.com/t/adding-a-new-module-location/15801/5 "2014-07-29T14:44:09Z")

</div>

Yep, its pointing to the directory.

Just to make it clearer.  
library = /usr/share/ansible:/path/to/custom/module\_directory

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 29, 2014, 3:01pm UTC](https://forum.ansible.com/t/adding-a-new-module-location/15801/6 "2014-07-29T15:01:56Z")

</div>

"This is the line in /etc/asnible/ansible.cfg "

This path may be part of the problem.

---

<div class="post-metadata">

**Author:** ![Mzp45](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@Mzp45](https://forum.ansible.com/u/Mzp45)\
**Post date:** [July 29, 2014, 3:39pm UTC](https://forum.ansible.com/t/adding-a-new-module-location/15801/7 "2014-07-29T15:39:58Z")

</div>

Sorry for the typos in the post but I checked and verified there are no typos in the file 🙂  
All of the other stuff like custom locations for roles and plugins are working fine except for the modules part.
