Use attributes to document module capabilities; warn about command module's check_mode support (#118)

* Improve formatting.

* Add 'api' action group attribute.

* Document attributes.

* Known issue: command module declares to support check mode.

* Compatibility with older ansible-core releases.

* Fix typo.

* Improve docs.

* Add shortcuts for common combinations.

* Update changelogs/fragments/command-check_mode.yml

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
This commit is contained in:
Felix Fontein 2022-11-06 20:58:06 +01:00 committed by GitHub
parent 29b604464a
commit 835cec5e24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 179 additions and 13 deletions

View file

@ -18,12 +18,23 @@ description:
- This module can add, remove, update, query and execute arbitrary command in RouterOS via API.
notes:
- I(add), I(remove), I(update), I(cmd) and I(query) are mutually exclusive.
- I(check_mode) is not supported.
- Use the M(community.routeros.api_modify) and M(community.routeros.api_find_and_modify) modules
for more specific modifications, and the M(community.routeros.api_info) module for a more controlled
way of returning all entries for a path.
extends_documentation_fragment:
- community.routeros.api
- community.routeros.attributes
- community.routeros.attributes.actiongroup_api
attributes:
check_mode:
support: none
diff_mode:
support: none
platform:
support: full
platforms: RouterOS
action_group:
version_added: 2.1.0
options:
path:
description:

View file

@ -28,6 +28,14 @@ description:
RouterOS API, similar to the M(community.routeros.api) module.
extends_documentation_fragment:
- community.routeros.api
- community.routeros.attributes
- community.routeros.attributes.actiongroup_api
- community.routeros.attributes.facts
- community.routeros.attributes.facts_module
attributes:
platform:
support: full
platforms: RouterOS
options:
gather_subset:
description:

View file

@ -24,9 +24,18 @@ notes:
there are at least N such values, you can use I(require_matches_min=N) together with I(allow_no_matches=true).
This will make the module fail if there are less than N such entries, but not if there is no match. The latter case
is needed for idempotency of the task: once the values have been changed, there should be no further match."
- Supports I(check_mode).
extends_documentation_fragment:
- community.routeros.api
- community.routeros.attributes
- community.routeros.attributes.actiongroup_api
attributes:
check_mode:
support: full
diff_mode:
support: full
platform:
support: full
platforms: RouterOS
options:
path:
description:

View file

@ -24,10 +24,15 @@ description:
- B(Note) that this module is still heavily in development, and only supports B(some) paths.
If you want to support new paths, or think you found problems with existing paths, please first
L(create an issue in the community.routeros Issue Tracker,https://github.com/ansible-collections/community.routeros/issues/).
notes:
- Supports I(check_mode).
extends_documentation_fragment:
- community.routeros.api
- community.routeros.attributes
- community.routeros.attributes.actiongroup_api
- community.routeros.attributes.info_module
attributes:
platform:
support: full
platforms: RouterOS
options:
path:
description:

View file

@ -24,12 +24,20 @@ description:
- B(Note) that this module is still heavily in development, and only supports B(some) paths.
If you want to support new paths, or think you found problems with existing paths, please first
L(create an issue in the community.routeros Issue Tracker,https://github.com/ansible-collections/community.routeros/issues/).
notes:
- Supports I(check_mode).
requirements:
- Needs L(ordereddict,https://pypi.org/project/ordereddict) for Python 2.6
extends_documentation_fragment:
- community.routeros.api
- community.routeros.attributes
- community.routeros.attributes.actiongroup_api
attributes:
check_mode:
support: full
diff_mode:
support: full
platform:
support: full
platforms: RouterOS
options:
path:
description:

View file

@ -20,6 +20,21 @@ description:
- The module always indicates a (changed) status. You can use
R(the changed_when task property,override_the_changed_result) to determine
whether a command task actually resulted in a change or not.
notes:
- The module declares that it B(supports check mode). This is a bug and will
be changed in community.routeros 3.0.0.
extends_documentation_fragment:
- community.routeros.attributes
attributes:
check_mode:
support: partial
details:
- The module claims to support check mode, but it simply always executes the command.
diff_mode:
support: none
platform:
support: full
platforms: RouterOS
options:
commands:
description:

View file

@ -18,6 +18,14 @@ description:
base network fact keys with C(ansible_net_<fact>). The facts
module will always collect a base set of facts from the device
and can enable or disable collection of additional facts.
extends_documentation_fragment:
- community.routeros.attributes
- community.routeros.attributes.facts
- community.routeros.attributes.facts_module
attributes:
platform:
support: full
platforms: RouterOS
options:
gather_subset:
description: