# How to package ansible modules? Can I use setuptools and console\_scripts?

**URL:** <https://forum.ansible.com/t/how-to-package-ansible-modules-can-i-use-setuptools-and-console-scripts/31237>\
**Category:** Ansible Project\
**Created:** [September 9, 2019, 1:33pm UTC](https://forum.ansible.com/t/how-to-package-ansible-modules-can-i-use-setuptools-and-console-scripts/31237 "2019-09-09T13:33:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan\_Midjich](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/stefan_midjich/32/9338_2.png) [@Stefan\_Midjich](https://forum.ansible.com/u/Stefan_Midjich)\
**Post date:** [September 9, 2019, 1:33pm UTC](https://forum.ansible.com/t/how-to-package-ansible-modules-can-i-use-setuptools-and-console-scripts/31237/1 "2019-09-09T13:33:16Z")

</div>

Hey

I was hoping to package my ansible modules to easier share code between them.

So I used setuptools and entry\_points.console\_scripts as you can see here [https://gitlab.com/stemid/ansible-siptrack/blob/2eac2c59c9e3381c847827b4333d3ccf8e649c96/setup.py](https://gitlab.com/stemid/ansible-siptrack/blob/2eac2c59c9e3381c847827b4333d3ccf8e649c96/setup.py)

I ended up with the modules installed in PATH like siptrack\_list.py and if I call them on the CLI they work, I can feed them JSON like {“ANSIBLE\_MODULE\_ARGS”: {“pattern”: “server-name”}} and they return a result.

I then symlinked them from PATH to library/siptrack\_list.py and tried using them in a playbook.

But if I tried calling them from an ansible playbook I get this error:

{“changed”: false, “msg”: “Error: Module unable to decode valid JSON on stdin. Unable to figure out what parameters were passed”}

What am I missing?
