Plugin development and distribution

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.

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.