Plugin development and distribution

26 views
Skip to first unread message

Alexander Lomski

unread,
May 31, 2017, 9:19:51 AM5/31/17
to Ansible Development
I've got a question that I cannot find the answer to anywhere.

I want to develop an Ansible lookup plugin and deploy it to PyPI, so the users would be able to install it with 'pip install'. But how will Ansible detect the presence of installed plugin? From what I could find, it will look in "./lookup_plugins" (not in option), "~/.ansible/plugins/lookup_plugins/" and "/usr/share/ansible_plugins/lookup_plugins/". While both latter options would work, they completely preclude installing my plugin into a virtualenv environment.

Setuptools provide two different methods for plugin discovery: namespace packages and entry points. I cannot find any indication that Ansible is making use of either. So: wow do I make my plugin discoverable by Ansible when installed into virtualenv?

Yours,
Alexander Lomski.

Matt Martz

unread,
May 31, 2017, 10:34:20 AM5/31/17
to Alexander Lomski, Ansible Development
Currently there is no supported way to pip install an ansible module in a way that ansible would be able to detect.

The only well known package doing this currently is ara, and you can find the documentation on how they achieve it at http://ara.readthedocs.io/en/latest/configuration.html

In affect, all users of your pip distributed ansible module would be required to modify their ansible.cfg to list the location of your package.


--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net
Reply all
Reply to author
Forward
0 new messages