# Extending Ansible

**URL:** <https://forum.ansible.com/t/extending-ansible/19101>\
**Category:** Ansible Developer\
**Created:** [August 24, 2015, 8:53pm UTC](https://forum.ansible.com/t/extending-ansible/19101 "2015-08-24T20:53:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Legleux](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Michael\_Legleux](https://forum.ansible.com/u/Michael_Legleux)\
**Post date:** [August 24, 2015, 8:53pm UTC](https://forum.ansible.com/t/extending-ansible/19101/1 "2015-08-24T20:53:29Z")

</div>

I’m trying to figure out how to use my changes to ansible-modules-extras locally.  
I have cloned the ansible and ansible-modules-extras locally and made changes to ansible-modules-extras.

I see that in ansible there is .gitmodules that contains the path where the submodules live and the url where the repositories are.

It doesn’t appear to be as easy as changing that url to my repo (also I would like to use the LOCAL submodule.)

What are the steps to go about this?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [August 24, 2015, 8:57pm UTC](https://forum.ansible.com/t/extending-ansible/19101/2 "2015-08-24T20:57:58Z")

</div>

you can put individual modules in a 'library' dir adjacent to your  
play or in a role, you can also point to them from ansible.cfg:  
library=...

---

<div class="post-metadata">

**Author:** ![Michael\_Legleux](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Michael\_Legleux](https://forum.ansible.com/u/Michael_Legleux)\
**Post date:** [August 25, 2015, 12:18am UTC](https://forum.ansible.com/t/extending-ansible/19101/3 "2015-08-25T00:18:28Z")

</div>

Thanks a lot!  
Adding my local repo to ansible.cfg seemed the path of least resistance.

ansible --version shows “configured module search path” = /where/my/forked/cloned/repo/lives

It still doesn’t seem to be working though.

Also, if I just put some garbage key/values for the module, ansible seems happy to just ignore them rather than saying “no parameter jkladfsjkldsf for module foo” I can only conclude that ansible ignores these garbage parameters, or my configuration is not correct.  
I’m trying to add a few more parameters to the win\_chocolatey module. Previously I was just passing the parameters in with the package name since that seemed to just get passed to the choco command. It worked buy now I’m trying to tackle it “the right way.”

Here’s the changes if anyone is interested: [https://github.com/legleux/ansible-modules-extras/blob/devel/windows/win\_chocolatey.ps1](https://github.com/legleux/ansible-modules-extras/blob/devel/windows/win_chocolatey.ps1)

One problem I have is that there are very few people who seem to be very familiar with BOTH chocolatey and ansible. I have just tried contacting Trond Hindenes to that end. So I’ll see what he says…

---

<div class="post-metadata">

**Author:** ![Michael\_Legleux](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Michael\_Legleux](https://forum.ansible.com/u/Michael_Legleux)\
**Post date:** [August 25, 2015, 12:22am UTC](https://forum.ansible.com/t/extending-ansible/19101/4 "2015-08-25T00:22:59Z")

</div>

whoops, I hadn’t actually pushed the changes to github yet. But I WAS using this locally…

[https://github.com/legleux/ansible-modules-extras/blob/win\_choco\_params/windows/win\_chocolatey.ps1](https://github.com/legleux/ansible-modules-extras/blob/win_choco_params/windows/win_chocolatey.ps1)

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [August 25, 2015, 12:28am UTC](https://forum.ansible.com/t/extending-ansible/19101/5 "2015-08-25T00:28:30Z")

</div>

I use the search path to my closed core and extras and it works, see  
if you are correctly pointing at the top directory for either repo.

As for the options, the ansible executable does not check them, this  
happens at the module execution using the 'spec', you should get a  
message from the module itself (via ansible) when this happens though.
