[PR #10770/3cc4f28f backport][stable-9] minor fixes in doc guides (#10778)

minor fixes in doc guides (#10770)

(cherry picked from commit 3cc4f28fd7)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot]
2025-08-31 12:10:47 +02:00
committed by GitHub
parent 72fc0fd22a
commit e930e3d42a
2 changed files with 5 additions and 3 deletions

View File

@@ -22,6 +22,7 @@ The same example from the Developer Guide would become:
from ansible_collections.community.general.plugins.module_utils import deps
with deps.declare("foo"):
import foo

View File

@@ -75,6 +75,7 @@ section above, but there are more elements that will take part in it.
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper
class MyTest(ModuleHelper):
output_params = ()
change_params = ()
@@ -256,9 +257,9 @@ With that, MH will automatically generate the diff output for variables that hav
class MyTest(ModuleHelper):
diff_params = ('value', )
def __run__(self):
# example from community.general.gio_mime
self.vars.set_meta("handler", initial_value=gio_mime_get(self.runner, self.vars.mime_type), diff=True, change=True)
def __run__(self):
# example from community.general.gio_mime
self.vars.set_meta("handler", initial_value=gio_mime_get(self.runner, self.vars.mime_type), diff=True, change=True)
Moreover, if a module is set to return *facts* instead of return values, then again use the metadata ``fact=True`` and ``fact_params`` for module parameters.
Additionally, you must specify ``facts_name``, as in: