ansible-community / antsibull-docs

Tooling for building Ansible documentation
https://ansible.readthedocs.io/projects/antsibull-docs/
GNU General Public License v3.0
29 stars 17 forks source link

'plugin' subcommand only supports 'modules' and not 'actions' #319

Closed julien-lecomte closed 3 months ago

julien-lecomte commented 3 months ago

My ansible collection has "actions" and not "modules" in order to run raw ssh commands without uploading anything on the target.

The module in this collection only works if the files are in the plugins/action folder, and not in the plugins/modules folder.

The issue with this is the documentation command that does search in plugins/action

For this reason, my Make recipe symlinks actions/*.py into modules/*.py, and then runs ANSIBLE_CONFIG=ansible.cfg antsibull-docs plugin --fail-on-error --plugin-type module --dest-dir docs/modules <plugin_qualified_name>. It then cleans up the symlinks.

Could it be possible for antsibull-docs to search in plugins/action if not finding in plugins/module?

One of the side effects of my "quickfix" is that my documentation now contains:

image

The project in question is here: https://gitlab.com/cappysan/ansible-collections/idrac

felixfontein commented 3 months ago

That's basically the way Ansible (and also ansible-doc) works. Action plugins always come with a module, even if it only contains documentation for that action plugin. For example, the ansible.builtin.template action (https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/action/template.py) has an accompanying "module" (https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/template.py) that only contains its documentation.

If you want this changed, you need to ask in https://github.com/ansible/ansible, because this is a restriction of ansible-doc.

julien-lecomte commented 3 months ago

I did not know that. Thanks for the explanation. I'll be closing this issue and fixing on my side.