Skip to content

Commit 553881e

Browse files
[Documentation] Modify template generation to allow for attributes to be used. (#1963)
* Update docs * Added attribute generation * Updated docs * Updated zos_copy rst * Updated the js2 template * Updated zos_copy * Updated script to add attributes section * Updated module template generation * Updated rst * Updated rst * Updated zos_script with attributes * Updated docs * Updated zos_copy * Updated script rst * Added changelog * Modified templates * Updated zos_script * Updated zos_script rst * Updated templates generation
1 parent 7f79e6b commit 553881e

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trivial:
2+
- docs/templates/module.rst.j2 - Adds support for including `attributes` keyword inside module's documentation.
3+
(https://github.com/ansible-collections/ibm_zos_core/pull/1963).

docs/source/modules/zos_script.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,23 @@ template_parameters
243243

244244

245245

246+
Attributes
247+
----------
248+
action
249+
| **support**: full
250+
| **description**: Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller.
251+
async
252+
| **support**: full
253+
| **description**: Supports being used with the ``async`` keyword.
254+
check_mode
255+
| **support**: none
256+
| **description**: Can run in check_mode and return changed status prediction without modifying target, if not supported the action will be skipped.
257+
diff_mode
258+
| **support**: none
259+
| **description**: Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.
260+
261+
262+
246263
Examples
247264
--------
248265

docs/templates/module.rst.j2

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,21 @@ Parameters
8686
{{ option_generation(options, 0) }}
8787
{% endif %}
8888

89+
{# ------------------------------------------------------------- #}
90+
{# Generate the attributes doc #}
91+
{# ------------------------------------------------------------- #}
92+
93+
{% if attributes -%}
94+
Attributes
95+
----------
96+
{% for name, spec in attributes.items() %}
97+
{{ name }}
98+
| **support**: {{ spec.support}}
99+
| **description**: {{ spec.description }}
100+
{% endfor %}
101+
102+
{% endif %}
103+
89104
{# ------------------------------------------------------------- #}
90105
{# Generate the sample doc #}
91106
{# ------------------------------------------------------------- #}

plugins/modules/zos_script.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,20 @@
9696
extends_documentation_fragment:
9797
- ibm.ibm_zos_core.template
9898
99+
attributes:
100+
action:
101+
support: full
102+
description: Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller.
103+
async:
104+
support: full
105+
description: Supports being used with the ``async`` keyword.
106+
check_mode:
107+
support: none
108+
description: Can run in check_mode and return changed status prediction without modifying target, if not supported the action will be skipped.
109+
diff_mode:
110+
support: none
111+
description: Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.
112+
99113
notes:
100114
- When executing local scripts, temporary storage will be used
101115
on the remote z/OS system. The size of the temporary storage will

0 commit comments

Comments
 (0)