generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use attributes to document module capabilities; warn about command mo…
…dule'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 <[email protected]> Co-authored-by: Brian Scholer <[email protected]>
- Loading branch information
1 parent
29b6044
commit 835cec5
Showing
11 changed files
with
179 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
known_issues: | ||
- "The ``community.routeros.command`` module claims to support check mode. | ||
Since it cannot judge whether the commands executed modify state or not, this behavior is incorrect. | ||
Since this potentially breaks existing playbooks, we will not change this behavior until community.routeros 3.0.0." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright (c) Ansible Project | ||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
|
||
class ModuleDocFragment(object): | ||
|
||
# Standard documentation fragment | ||
DOCUMENTATION = r''' | ||
options: {} | ||
attributes: | ||
check_mode: | ||
description: Can run in C(check_mode) and return changed status prediction without modifying target. | ||
diff_mode: | ||
description: Will return details on what has changed (or possibly needs changing in C(check_mode)), when in diff mode. | ||
platform: | ||
description: Target OS/families that can be operated against. | ||
support: N/A | ||
''' | ||
|
||
# Should be used together with the standard fragment | ||
INFO_MODULE = r''' | ||
options: {} | ||
attributes: | ||
check_mode: | ||
support: full | ||
details: | ||
- This action does not modify state. | ||
diff_mode: | ||
support: N/A | ||
details: | ||
- This action does not modify state. | ||
''' | ||
|
||
ACTIONGROUP_API = r''' | ||
options: {} | ||
attributes: | ||
action_group: | ||
description: Use C(group/community.routeros.api) in C(module_defaults) to set defaults for this module. | ||
support: full | ||
membership: | ||
- community.routeros.api | ||
''' | ||
|
||
CONN = r''' | ||
options: {} | ||
attributes: | ||
become: | ||
description: Is usable alongside C(become) keywords. | ||
connection: | ||
description: Uses the target's configured connection information to execute code on it. | ||
delegation: | ||
description: Can be used in conjunction with C(delegate_to) and related keywords. | ||
''' | ||
|
||
FACTS = r''' | ||
options: {} | ||
attributes: | ||
facts: | ||
description: Action returns an C(ansible_facts) dictionary that will update existing host facts. | ||
''' | ||
|
||
# Should be used together with the standard fragment and the FACTS fragment | ||
FACTS_MODULE = r''' | ||
options: {} | ||
attributes: | ||
check_mode: | ||
support: full | ||
details: | ||
- This action does not modify state. | ||
diff_mode: | ||
support: N/A | ||
details: | ||
- This action does not modify state. | ||
facts: | ||
support: full | ||
''' | ||
|
||
FILES = r''' | ||
options: {} | ||
attributes: | ||
safe_file_operations: | ||
description: Uses Ansible's strict file operation functions to ensure proper permissions and avoid data corruption. | ||
''' | ||
|
||
FLOW = r''' | ||
options: {} | ||
attributes: | ||
action: | ||
description: Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller. | ||
async: | ||
description: Supports being used with the C(async) keyword. | ||
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters