How to package ansible modules? Can I use setuptools and console_scripts?

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

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?