Skip to content

Commit 6d8f492

Browse files
add doc changes
1 parent ebd1e8c commit 6d8f492

File tree

8 files changed

+81
-20
lines changed

8 files changed

+81
-20
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
minor_changes:
2+
- playbook_upgrade_validator - Adding a role that automatically scans the playbooks in the directory and advises of migration actions.
3+
(https://github.com/ansible-collections/ibm_zos_core/pull/2399)

plugins/modules/playbook_upgrade_validator.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
version_added: "1.0.0"
2121
author:
2222
- "Ravella Surendra Babu (@surendrababuravella)"
23-
short_description: Validate playbooks against ibm_zos_core 2.0
23+
short_description: Validates playbooks against ibm_zos_core 2.0 and provides migration actions.
2424
description:
2525
- Scans one or more Ansible playbooks to identify deprecated or renamed parameters
2626
based on migration rules for IBM z/OS core collection version 2.0.
@@ -33,7 +33,8 @@
3333
type: bool
3434
migration_map:
3535
description:
36-
- File path where validation results should be written in JSON format.
36+
- A structured set of migration rules that specifies deprecated, renamed, and modified parameters
37+
to help upgrade playbooks from ibm_zos_core 1.x to 2.0.
3738
required: true
3839
type: dict
3940
output_path:
@@ -62,14 +63,38 @@
6263
'''
6364

6465
RETURN = r'''
66+
changed:
67+
description:
68+
- Always false as there is no state changes happen in this process.
69+
returned: always
70+
type: bool
6571
output_path:
66-
description: Path where the validation report was written.
72+
description: File path where validation results should be written in JSON format.
73+
returned: always
74+
type: str
75+
playbook_path:
76+
description: The path to the directory containing one or more Ansible playbooks.
6777
returned: always
6878
type: str
6979
results:
70-
description: List of all issues found across all playbooks.
80+
description: List of issues identified in all scanned playbooks, along with detailed information.
7181
returned: always
7282
type: list
83+
sample:
84+
[
85+
{
86+
"line": 9,
87+
"migration_actions": [
88+
"[MUST_FIX] Param 'force_lock' is renamed to 'force' in zos_copy",
89+
"[MUST_FIX] Param 'is_binary' is renamed to 'binary' in zos_copy",
90+
"[MUST_FIX] Param 'force' is renamed to 'replace' in zos_copy"
91+
],
92+
"module": "zos_copy",
93+
"play_name": "Execute z/OS modules",
94+
"playbook": "/path/to/playbook/copy_file.yml",
95+
"task_name": "copy file to z/os"
96+
}
97+
]
7398
'''
7499

75100
from ansible.module_utils.basic import AnsibleModule

roles/playbook_upgrade_validator/docs/doc_playbook_upgrade_validator

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,83 @@
1111

1212
DOCUMENTATION = r'''
1313
---
14-
role: job_status
14+
module: playbook_upgrade_validator
15+
version_added: "1.0.0"
1516
author:
1617
- "Ravella Surendra Babu (@surendrababuravella)"
1718
short_description: Validates playbooks against ibm_zos_core 2.0 and provides migration actions.
1819
description:
1920
- Scans one or more Ansible playbooks to identify deprecated or renamed parameters
2021
based on migration rules for IBM z/OS core collection version 2.0.
21-
- Provides line numbers, affected modules, and suggests corrective actions.
22+
- Provides line numbers, affected modules, and suggested corrective actions.
2223
options:
23-
playbook_path:
24+
ignore_response_params:
2425
description:
25-
- The path to the directory containing one or more Ansible playbooks.
26+
- Indicates whether information about response parameter changes should be included.
27+
default: false
28+
type: bool
29+
migration_map:
30+
description:
31+
- A structured set of migration rules that specifies deprecated, renamed, and modified parameters
32+
to help upgrade playbooks from ibm_zos_core 1.x to 2.0.
2633
required: true
27-
type: str
34+
type: dict
2835
output_path:
2936
description:
3037
- File path where validation results should be written in JSON format.
3138
required: true
3239
type: str
33-
ignore_response_params:
40+
playbook_path:
3441
description:
35-
- Indicates whether information about response parameter changes should be included.
36-
default: false
37-
type: bool
42+
- The path to the directory containing one or more Ansible playbooks.
43+
required: true
44+
type: str
3845
notes:
3946
- Designed to assist migration of playbooks from older IBM z/OS core collection versions to 2.0.
4047
- Supports reading tasks, blocks, and nested includes.
4148
'''
4249

4350
EXAMPLES = r'''
4451
- name: execute playbook_upgrade_validator role
45-
include_role:
52+
include_role:
4653
name: ibm.ibm_zos_core.playbook_upgrade_validator
4754
vars:
4855
playbook_path: "/path/to/playbooks/*.yml"
49-
output_path: "{{ role_path }}/reports/validation_report.json"
56+
output_path: "/path/to/reports/validation_report.json"
5057
ignore_response_params: false
5158
'''
5259

5360
RETURN = r'''
61+
changed:
62+
description:
63+
- Always false as there is no state changes happen in this process.
64+
returned: always
65+
type: bool
5466
output_path:
55-
description: Path where the validation report was written.
67+
description: File path where validation results should be written in JSON format.
68+
returned: always
69+
type: str
70+
playbook_path:
71+
description: The path to the directory containing one or more Ansible playbooks.
5672
returned: always
5773
type: str
5874
results:
59-
description: List of all issues found across all playbooks.
75+
description: List of issues identified in all scanned playbooks, along with detailed information.
6076
returned: always
6177
type: list
78+
sample:
79+
[
80+
{
81+
"line": 9,
82+
"migration_actions": [
83+
"[MUST_FIX] Param 'force_lock' is renamed to 'force' in zos_copy",
84+
"[MUST_FIX] Param 'is_binary' is renamed to 'binary' in zos_copy",
85+
"[MUST_FIX] Param 'force' is renamed to 'replace' in zos_copy"
86+
],
87+
"module": "zos_copy",
88+
"play_name": "Execute z/OS modules",
89+
"playbook": "/path/to/playbook/copy_file.yml",
90+
"task_name": "copy file to z/os"
91+
}
92+
]
6293
'''

tests/sanity/ignore-2.15.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ plugins/modules/zos_archive.py validate-modules:missing-gplv3-license # Licensed
2626
plugins/modules/zos_unarchive.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2727
plugins/modules/zos_zfs_resize.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2828
plugins/modules/zos_started_task.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
29+
plugins/modules/playbook_upgrade_validator.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0

tests/sanity/ignore-2.16.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ plugins/modules/zos_volume_init.py validate-modules:missing-gplv3-license # Lice
2626
plugins/modules/zos_archive.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2727
plugins/modules/zos_unarchive.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2828
plugins/modules/zos_zfs_resize.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
29-
plugins/modules/playbook_upgrade_validator.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
3029
plugins/modules/zos_started_task.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
30+
plugins/modules/playbook_upgrade_validator.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0

tests/sanity/ignore-2.17.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ plugins/modules/zos_volume_init.py validate-modules:missing-gplv3-license # Lice
2626
plugins/modules/zos_archive.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2727
plugins/modules/zos_unarchive.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2828
plugins/modules/zos_zfs_resize.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
29-
plugins/modules/playbook_upgrade_validator.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
3029
plugins/modules/zos_started_task.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
30+
plugins/modules/playbook_upgrade_validator.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0

tests/sanity/ignore-2.18.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ plugins/modules/zos_volume_init.py validate-modules:missing-gplv3-license # Lice
2626
plugins/modules/zos_archive.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2727
plugins/modules/zos_unarchive.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2828
plugins/modules/zos_zfs_resize.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
29-
plugins/modules/playbook_upgrade_validator.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
3029
plugins/modules/zos_started_task.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
30+
plugins/modules/playbook_upgrade_validator.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0

tests/sanity/ignore-2.19.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ plugins/modules/zos_volume_init.py validate-modules:missing-gplv3-license # Lice
2626
plugins/modules/zos_archive.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2727
plugins/modules/zos_unarchive.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2828
plugins/modules/zos_zfs_resize.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
29+
plugins/modules/zos_started_task.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
2930
plugins/modules/playbook_upgrade_validator.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0

0 commit comments

Comments
 (0)