How to document support for check mode for a module

17 views
Skip to first unread message

Andreas Maier

unread,
Jun 9, 2021, 7:04:01 AM6/9/21
to Ansible Development
Hi,
I am an author of Ansible modules (e.g. https://github.com/zhmcclient/zhmc-ansible-modules) and would like to document whether a module supports check mode.

In modules written in Python, the module declares that at run time, e.g.

    module = AnsibleModule(
        argument_spec=argument_spec,
        supports_check_mode=True)

but there is no corresponding declaration in the module DOCUMENTATION string (that I know of). Also, I do not know of a way to access that runtime declaration in the docs template that is used by the ansible doc extractor tool.

My question is: Is there a recommendation on how to document whether a module supports check mode?

Brian Coca

unread,
Jun 9, 2021, 1:41:02 PM6/9/21
to Andreas Maier, Ansible Development
Just added this for 2.12 (still not final)
https://github.com/ansible/ansible/pull/73707

Also see https://github.com/ansible/ansible/pull/74331
--
----------
Brian Coca

Andreas Maier

unread,
Jun 9, 2021, 11:59:34 PM6/9/21
to Ansible Development
This is what i was looking for. Thanks much!!

Felix Fontein

unread,
Jun 10, 2021, 3:11:34 AM6/10/21
to ansibl...@googlegroups.com
Hi,

the common way to document this (that will also work with already
released ansible-core/base/ versions) is to add an entry to `notes:`
which says `Supports C(check_mode).` or something like that.

Cheers,
Felix

Reply all
Reply to author
Forward
0 new messages