How to mark private plugins (or modules or roles) in a collection; how to store extra (non-core) metadata on modules/plugins/roles in collections

There is some desire from content creators to create “hidden” plugins, modules, or roles in a collection that are only for internal usage in that collection, and shall not show up in any documentation (including ansible-doc --list).

There was a discussion on this in the original community-topics repository (How to mark private plugins in a collection (with a proposal and implementation) · Issue #154 · ansible-community/community-topics · GitHub), but it never concluded so far. Core team seems to be opposed to this in general.

One approach would be to use another file, like meta/extra.yml or something like that (see How to mark private plugins in a collection (with a proposal and implementation) · Issue #154 · ansible-community/community-topics · GitHub, How to mark private plugins in a collection (with a proposal and implementation) · Issue #154 · ansible-community/community-topics · GitHub) to allow other actors than Core to store metadata on plugins (or the collection in general). I think that is worth discussing, also to include potential other metadata for other tools.

I’m creating this thread so we have a place to continue this discussion.

We are opposed to any change that attempts to denote this in core code in any means. As such, ansible-doc would not obey any such mechanism.

I don’t know if this would be feasible, but how about moving private / hidden code to a new directory? Like plugins/module_utils_hidden or plugins/private/module_utils?

Would this be a solution?

Just think out loud here…

That only works for module utils and plugin utils, which do not have automatic documentation (and are listed by ansible-doc -l) anyway. For plugins and modules, putting them into another directory effectively prevents any use of them. So that unfortunately won’t work :slight_smile:

That’s (still) too bad.