# Workflow and distribution when developing modules

**URL:** <https://forum.ansible.com/t/workflow-and-distribution-when-developing-modules/16017>\
**Category:** Ansible Developer\
**Created:** [August 22, 2014, 4:33pm UTC](https://forum.ansible.com/t/workflow-and-distribution-when-developing-modules/16017 "2014-08-22T16:33:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_VanGundy](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@Ryan\_VanGundy](https://forum.ansible.com/u/Ryan_VanGundy)\
**Post date:** [August 22, 2014, 4:33pm UTC](https://forum.ansible.com/t/workflow-and-distribution-when-developing-modules/16017/1 "2014-08-22T16:33:25Z")

</div>

I’m curious as to how best to develop and distribute a 3rd-party module. Currently I’m working in an Ansible development branch. My module is in the library folder, and I’m running tests using hacking/test-module. This has been a good workflow, especially when using the --debugger flag.

In order for me to run my module in production I’m running “make install”, which creates a new Ansible build. I’m guessing that in order for others to use this module they would have to do the same.

I’m working on two modules, both a digitalocean API v2 module and a JSON config file manipulation module. Both of these I think could be included in core eventually. Though for now, I’d rather develop these in their own repositories independent of the Ansible project.

How might a third-party module be distributed? I’ve read about adding a /library file relative to a playbook (cool!). For more general use modules that I’d like to distribute to several people for use across multiple projects, how might a user “install” a module without executing a new Ansible build?

---

<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:** [August 22, 2014, 4:50pm UTC](https://forum.ansible.com/t/workflow-and-distribution-when-developing-modules/16017/2 "2014-08-22T16:50:20Z")

</div>

​Just copy that one module file in said library/ folder​ is more than  
enough.  
I have some (old) modules I made available through a more general plugins  
repo:

&nbsp;&nbsp;[https://github.com/ginsys/ansible-plugins/tree/devel/library](https://github.com/ginsys/ansible-plugins/tree/devel/library)

In most cases, a module is just one file, so whatever means should work.

That being said, nowadays a lot of common code can now be placed in  
lib/ansible/module\_utils/  
IIRC that location is not 'pluggeable'', so no custom location like other  
plugins where to put shared code fragments.

This is something that still should be implemented IMHO. IIRC Michael was  
open to that.

&nbsp;&nbsp;&nbsp;&nbsp;Serge

---

<div class="post-metadata">

**Author:** ![Ryan\_VanGundy](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@Ryan\_VanGundy](https://forum.ansible.com/u/Ryan_VanGundy)\
**Post date:** [August 22, 2014, 5:16pm UTC](https://forum.ansible.com/t/workflow-and-distribution-when-developing-modules/16017/3 "2014-08-22T17:16:03Z")

</div>

Alright, I can see this working. In my development folder, I’ll put my module in a /library folder and a playbook at the root that I use for running various tests against the module, like…

myModuleProject

> – library  
> – myModule  
> – test\_playbook.yml

Still doesn’t completely solve the distribution problem. But are you saying that if I put a module file in to /lib/ansible/module\_utils, it will run? Guess I’ll go give it a shot…

---

<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:** [August 22, 2014, 5:55pm UTC](https://forum.ansible.com/t/workflow-and-distribution-when-developing-modules/16017/4 "2014-08-22T17:55:57Z")

</div>

> Still doesn't completely solve the distribution problem.

Depends. I was just saying that if you document a module can be put in  
library/, you just need to distribute that single module file.​

> But are you saying that if I put a module file in to  
> /lib/ansible/module\_utils, it will run? Guess I'll go give it a shot...

If you put a "python module​"-style file to be imported into your module  
file in that location, then yes.

Serge
