# 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

**URL:** <https://forum.ansible.com/t/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/5736>\
**Category:** Project Discussions\
**Tags:** community-wg, collections\
**Created:** [May 10, 2024, 4:53pm UTC](https://forum.ansible.com/t/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/5736 "2024-05-10T16:53:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [May 10, 2024, 4:53pm UTC](https://forum.ansible.com/t/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/5736/1 "2024-05-10T16:53:37Z")

</div>

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](https://github.com/ansible-community/community-topics/issues/154)), 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](https://github.com/ansible-community/community-topics/issues/154#issuecomment-1464590465), [How to mark private plugins in a collection (with a proposal and implementation) · Issue #154 · ansible-community/community-topics · GitHub](https://github.com/ansible-community/community-topics/issues/154#issuecomment-1465108005)) 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.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [May 13, 2024, 5:03pm UTC](https://forum.ansible.com/t/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/5736/2 "2024-05-13T17:03:19Z")

</div>

> [@felixfontein](#):
>
> Core team seems to be opposed to this in general.

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.

---

<div class="post-metadata">

**Author:** ![mariolenz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mariolenz/32/108_2.png) [@mariolenz](https://forum.ansible.com/u/mariolenz)\
**Post date:** [May 13, 2024, 6:29pm UTC](https://forum.ansible.com/t/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/5736/3 "2024-05-13T18:29:40Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [May 13, 2024, 6:45pm UTC](https://forum.ansible.com/t/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/5736/4 "2024-05-13T18:45:36Z")

</div>

> [@mariolenz](#):
>
> 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?

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 🙂

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [May 13, 2024, 6:46pm UTC](https://forum.ansible.com/t/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/5736/5 "2024-05-13T18:46:50Z")

</div>

> [@sivel](#):
>
> > [@felixfontein](#):
> >
> > Core team seems to be opposed to this in general.
> 
> 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.

That’s (still) too bad.
