├── .ansible-lint ├── .flake8 ├── .gitignore ├── CHANGELOG.rst ├── Jenkinsfile ├── LICENSE ├── README.md ├── bindep.txt ├── changelogs ├── changelog.yaml └── config.yaml ├── docs ├── Makefile ├── ansible_content.rst ├── scripts │ └── auto-doc-gen.sh ├── source │ ├── community_guides.rst │ ├── conf.py │ ├── index.rst │ ├── installation.rst │ ├── license.rst │ ├── modules.rst │ ├── modules │ │ ├── zmf_authenticate.rst │ │ ├── zmf_sca.rst │ │ └── zmf_workflow.rst │ ├── playbooks.rst │ ├── release_notes.rst │ ├── requirements-single.rst │ ├── requirements.rst │ ├── requirements_control.rst │ ├── requirements_managed.rst │ ├── resources.rst │ ├── roles.rst │ └── roles │ │ ├── zmf_cpm_create_software_instance.rst │ │ ├── zmf_cpm_get_software_instance.rst │ │ ├── zmf_cpm_list_software_templates.rst │ │ ├── zmf_cpm_manage_software_instance.rst │ │ ├── zmf_cpm_provision_software_service.rst │ │ ├── zmf_cpm_remove_software_instance.rst │ │ ├── zmf_swmgmt_csi_query.rst │ │ ├── zmf_swmgmt_identify_missing_critical_updates.rst │ │ ├── zmf_swmgmt_identify_missing_fixcat_updates.rst │ │ ├── zmf_swmgmt_search_software_updates.rst │ │ ├── zmf_swmgmt_zos_system_uuid.rst │ │ ├── zmf_workflow_complete.rst │ │ └── zmf_zmsc_run_management_service.rst └── templates │ ├── breadcrumbs.html │ ├── module.rst.j2 │ └── role.rst.j2 ├── galaxy.yml ├── meta ├── execution-environment.yml ├── requirements.txt ├── requirements.yml └── runtime.yml ├── plugins ├── module_utils │ ├── zmf_auth_api.py │ ├── zmf_sca_api.py │ ├── zmf_util.py │ └── zmf_workflow_api.py └── modules │ ├── zmf_authenticate.py │ ├── zmf_sca.py │ └── zmf_workflow.py ├── requirements.txt ├── roles ├── zmf_cpm_create_software_instance │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_cpm_create_software_instance │ ├── meta │ │ └── main.yml │ └── tasks │ │ ├── instance_dir_util.yml │ │ └── main.yml ├── zmf_cpm_get_software_instance │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_cpm_get_software_instance │ ├── meta │ │ └── main.yml │ └── tasks │ │ ├── instance_dir_util.yml │ │ └── main.yml ├── zmf_cpm_list_software_templates │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_cpm_list_software_templates │ ├── meta │ │ └── main.yml │ └── tasks │ │ ├── instance_dir_util.yml │ │ └── main.yml ├── zmf_cpm_manage_software_instance │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_cpm_manage_software_instance │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── zmf_cpm_provision_software_service │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_cpm_provision_software_service │ ├── meta │ │ └── main.yml │ └── tasks │ │ ├── instance_dir_util.yml │ │ ├── loop_instance_provision_step_state.yml │ │ └── main.yml ├── zmf_cpm_remove_software_instance │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_cpm_remove_software_instance │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── zmf_swmgmt_csi_query │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_swmgmt_csi_query │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── zmf_swmgmt_identify_missing_critical_updates │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_swmgmt_identify_missing_critical_updates │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── zmf_swmgmt_identify_missing_fixcat_updates │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_swmgmt_identify_missing_fixcat_updates │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── zmf_swmgmt_search_software_updates │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_swmgmt_search_software_updates │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── zmf_swmgmt_zos_system_uuid │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_swmgmt_zos_system_uuid │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── zmf_workflow_complete │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── docs │ │ └── doc_zmf_workflow_complete │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml └── zmf_zmsc_run_management_service │ ├── README.md │ ├── defaults │ └── main.yml │ ├── docs │ └── doc_zmf_zmsc_run_management_service │ ├── meta │ └── main.yml │ └── tasks │ ├── instance_dir_util.yml │ ├── loop_service_state_check.yml │ └── main.yml └── tests ├── .DS_Store ├── CICD └── playbooks │ ├── README.md │ ├── ansible.cfg │ ├── cpm_complete_CICDtest1.yml │ ├── group_vars │ ├── ClientCtr.yml │ ├── sca.yml │ ├── swmgmt.yml │ └── workflow.yml │ ├── hosts │ ├── sca_1_passed.json │ ├── sca_CICDtest1.yml │ ├── software_management_csi_query_CICDtest1.yml │ ├── software_management_reports_CICDtest1.yml │ ├── software_management_system_uuid_CICDtest1.yml │ ├── workflow_complete_CICDtest1.yml │ └── zmsc_run_mgmt_service_CICDTest1.yml └── sanity ├── ignore-2.10.txt ├── ignore-2.11.txt ├── ignore-2.12.txt ├── ignore-2.13.txt ├── ignore-2.14.txt ├── ignore-2.15.txt ├── ignore-2.16.txt └── ignore-2.9.txt /.ansible-lint: -------------------------------------------------------------------------------- 1 | exclude_paths: 2 | - tests/ 3 | - docs/ 4 | skip_list: 5 | - name[template] 6 | - schema[meta] 7 | - var-naming[no-role-prefix] 8 | parseable: true 9 | quiet: false 10 | use_default_rules: true 11 | verbosity: 1 12 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = E402,W503,W504 3 | max-line-length = 121 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ############################# 2 | # Compiled source # 3 | ############################# 4 | *.com 5 | *.class 6 | *.dll 7 | *.exe 8 | *.o 9 | *.so 10 | 11 | ############################# 12 | # Packages # 13 | ############################# 14 | # It's better to unpack these files and commit the raw source. 15 | # Git has its own built in compression methods. 16 | *.7z 17 | *.dmg 18 | *.gz 19 | *.iso 20 | *.jar 21 | *.rar 22 | *.tar 23 | *.zip 24 | 25 | ############################# 26 | # Output Folders # 27 | ############################# 28 | bin/ 29 | obj/ 30 | out/ 31 | 32 | ############################# 33 | # Logs and databases # 34 | ############################# 35 | *.log 36 | *.sql 37 | *.sqlite 38 | 39 | ############################# 40 | # OS generated files # 41 | ############################# 42 | .DS_Store 43 | .DS_Store? 44 | ._* 45 | .Spotlight-V100 46 | .Trashes 47 | ehthumbs.db 48 | Thumbs.db 49 | 50 | ############################# 51 | # Backup or temporary files # 52 | ############################# 53 | *.pyo 54 | *.pyc 55 | *~ 56 | *.bak 57 | *.swp 58 | 59 | # Byte-compiled / optimized / DLL files 60 | __pycache__/ 61 | *.py[cod] 62 | *$py.class 63 | 64 | # Distribution / packaging 65 | .Python 66 | build/ 67 | develop-eggs/ 68 | dist/ 69 | downloads/ 70 | eggs/ 71 | .eggs/ 72 | lib/ 73 | lib64/ 74 | parts/ 75 | sdist/ 76 | var/ 77 | wheels/ 78 | pip-wheel-metadata/ 79 | share/python-wheels/ 80 | *.egg-info/ 81 | .installed.cfg 82 | *.egg 83 | MANIFEST 84 | 85 | # PyInstaller 86 | # Usually these files are written by a python script from a template 87 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 88 | *.manifest 89 | *.spec 90 | 91 | # Installer logs 92 | pip-log.txt 93 | pip-delete-this-directory.txt 94 | 95 | # Unit test / coverage reports 96 | htmlcov/ 97 | .tox/ 98 | .nox/ 99 | .coverage 100 | .coverage.* 101 | .cache 102 | nosetests.xml 103 | coverage.xml 104 | *.cover 105 | *.py,cover 106 | .hypothesis/ 107 | .pytest_cache/ 108 | 109 | # Translations 110 | *.mo 111 | *.pot 112 | 113 | # Django stuff: 114 | *.log 115 | local_settings.py 116 | db.sqlite3 117 | db.sqlite3-journal 118 | 119 | # Flask stuff: 120 | instance/ 121 | .webassets-cache 122 | 123 | # Scrapy stuff: 124 | .scrapy 125 | 126 | # Sphinx documentation 127 | docs/_build/ 128 | 129 | # PyBuilder 130 | target/ 131 | 132 | # Jupyter Notebook 133 | .ipynb_checkpoints 134 | 135 | # IPython 136 | profile_default/ 137 | ipython_config.py 138 | 139 | # pyenv 140 | .python-version 141 | 142 | # pipenv 143 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 144 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 145 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 146 | # install all needed dependencies. 147 | #Pipfile.lock 148 | 149 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 150 | __pypackages__/ 151 | 152 | # Celery stuff 153 | celerybeat-schedule 154 | celerybeat.pid 155 | 156 | # SageMath parsed files 157 | *.sage.py 158 | 159 | # Environments 160 | .env 161 | .venv 162 | env/ 163 | venv/ 164 | ENV/ 165 | env.bak/ 166 | venv.bak/ 167 | 168 | # Spyder project settings 169 | .spyderproject 170 | .spyproject 171 | 172 | # Rope project settings 173 | .ropeproject 174 | 175 | # mkdocs documentation 176 | /site 177 | 178 | # mypy 179 | .mypy_cache/ 180 | .dmypy.json 181 | dmypy.json 182 | 183 | # Pyre type checker 184 | .pyre/ 185 | 186 | *.retry 187 | 188 | # Visual Studio Code workspace configuration files 189 | .vscode/* 190 | .vscode/ 191 | !.vscode/tasks.json 192 | !.vscode/launch.json 193 | !.vscode/extensions.json 194 | *.code-workspace 195 | .vscode/settings.json 196 | 197 | # Development files 198 | # hosts 199 | .ansible-test/ 200 | .keep 201 | shell_exploits.txt 202 | tests/collections 203 | 204 | # changelog 205 | changelogs/.plugin-cache.yaml 206 | -------------------------------------------------------------------------------- /CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | Ibm.Ibm_Zosmf Release Notes 3 | =========================== 4 | 5 | .. contents:: Topics 6 | 7 | v1.5.0 8 | ====== 9 | 10 | Major Changes 11 | ------------- 12 | 13 | - Added new roles for z/OSMF Software Management 14 | 15 | Minor Changes 16 | ------------- 17 | 18 | - Updated the z/OSMF Software Management roles from a previous release to support UUID 19 | 20 | New Roles 21 | --------- 22 | 23 | - ibm.ibm_zosmf.zmf_swmgmt_csi_query - Role queries a SMP/E global zone CSI data set 24 | - ibm.ibm_zosmf.zmf_swmgmt_system_uuid - Role determines a z/OS system's UUID 25 | 26 | v1.4.2 27 | ====== 28 | 29 | Minor Changes 30 | ------------- 31 | 32 | - The README has been updated with a new template. 33 | - Fixed role `zmf_workflow_complete` which previously failed to return final_result. 34 | 35 | v1.4.1 36 | ====== 37 | 38 | Minor Changes 39 | ------------- 40 | 41 | - Documentation updates 42 | - Fixed ansible-lint issues 43 | 44 | v1.4.0 45 | ====== 46 | 47 | Major Changes 48 | ------------- 49 | 50 | - Added new roles for z/OS Management Services Catalog 51 | 52 | Minor Changes 53 | ------------- 54 | 55 | - Updated module `zmf_workflow` which returns the failed step if the workflow is not completed. 56 | 57 | New Roles 58 | --------- 59 | 60 | - ibm.ibm_zosmf.zmf_zmsc_run_management_service - Role runs a z/OS management service 61 | 62 | v1.3.0 63 | ====== 64 | 65 | Major Changes 66 | ------------- 67 | 68 | - Added new roles for z/OSMF Software Management 69 | 70 | New Roles 71 | --------- 72 | 73 | - ibm.ibm_zosmf.zmf_swmgmt_identify_missing_critical_updates - Role identifies missing critical updates 74 | - ibm.ibm_zosmf.zmf_swmgmt_identify_missing_fixcat_updates - Role identifies missing fixcat updates 75 | - ibm.ibm_zosmf.zmf_swmgmt_search_software_updates - Role searches for software updates 76 | 77 | v1.2.1 78 | ====== 79 | 80 | Major Changes 81 | ------------- 82 | 83 | - Removed dependency on Requests library for Python on the control node. 84 | 85 | v1.2.0 86 | ====== 87 | 88 | Major Changes 89 | ------------- 90 | 91 | - Updated module `zmf_sca` which adds support for the security requirements provision. 92 | 93 | New Modules 94 | ----------- 95 | 96 | - ibm.ibm_zosmf.zmf_sca - Automate z/OS security requirements validation and provision 97 | 98 | v1.1.0 99 | ====== 100 | 101 | New Modules 102 | ----------- 103 | 104 | - ibm.ibm_zosmf.zmf_sca - Automate z/OS security requirements validation and provision 105 | 106 | New Roles 107 | --------- 108 | 109 | - ibm.ibm_zosmf.zmf_cpm_create_software_instance - Role creates a z/OS software instance 110 | - ibm.ibm_zosmf.zmf_cpm_get_software_instance - Role get specific z/OS software instance 111 | - ibm.ibm_zosmf.zmf_cpm_list_software_templates - Role lists all published z/OS software templates 112 | 113 | v1.0.1 114 | ====== 115 | 116 | New Modules 117 | ----------- 118 | 119 | - ibm.ibm_zosmf.zmf_authenticate - Authenticate with z/OSMF server 120 | - ibm.ibm_zosmf.zmf_workflow - Operate z/OS workflows 121 | 122 | New Roles 123 | --------- 124 | 125 | - ibm.ibm_zosmf.zmf_cpm_manage_software_instance - Role manages a provisioned z/OS software instance 126 | - ibm.ibm_zosmf.zmf_cpm_provision_software_service - Role provisions a z/OS software service 127 | - ibm.ibm_zosmf.zmf_cpm_remove_software_instance - Role removes a z/OS software instance 128 | - ibm.ibm_zosmf.zmf_workflow_complete - Role completes a z/OS workflow 129 | -------------------------------------------------------------------------------- /bindep.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # © Copyright IBM Corporation 2021 3 | ################################################################################ 4 | # This file maintains a list of any binary dependencies needed by this 5 | # Collection. At this time there are no binary dependencies. 6 | # For more information on Bindep, 7 | # see https://docs.opendev.org/opendev/bindep/latest/readme.html 8 | ################################################################################ -------------------------------------------------------------------------------- /changelogs/changelog.yaml: -------------------------------------------------------------------------------- 1 | ancestor: null 2 | releases: 3 | 1.0.1: 4 | fragments: 5 | - 1.0.1.yaml 6 | modules: 7 | - description: Authenticate with z/OSMF server 8 | name: zmf_authenticate 9 | namespace: '' 10 | - description: Operate z/OS workflows 11 | name: zmf_workflow 12 | namespace: '' 13 | objects: 14 | role: 15 | - description: Role manages a provisioned z/OS software instance 16 | name: zmf_cpm_manage_software_instance 17 | namespace: null 18 | - description: Role provisions a z/OS software service 19 | name: zmf_cpm_provision_software_service 20 | namespace: null 21 | - description: Role removes a z/OS software instance 22 | name: zmf_cpm_remove_software_instance 23 | namespace: null 24 | - description: Role completes a z/OS workflow 25 | name: zmf_workflow_complete 26 | namespace: null 27 | release_date: '2021-06-18' 28 | 1.1.0: 29 | fragments: 30 | - 1.1.0.yaml 31 | modules: 32 | - description: Automate z/OS security requirements validation and provision 33 | name: zmf_sca 34 | namespace: '' 35 | objects: 36 | role: 37 | - description: Role creates a z/OS software instance 38 | name: zmf_cpm_create_software_instance 39 | namespace: null 40 | - description: Role get specific z/OS software instance 41 | name: zmf_cpm_get_software_instance 42 | namespace: null 43 | - description: Role lists all published z/OS software templates 44 | name: zmf_cpm_list_software_templates 45 | namespace: null 46 | release_date: '2022-01-18' 47 | 1.2.0: 48 | changes: 49 | major_changes: 50 | - Updated module `zmf_sca` which adds support for the security requirements 51 | provision. 52 | modules: 53 | - description: Automate z/OS security requirements validation and provision 54 | name: zmf_sca 55 | namespace: '' 56 | release_date: '2022-07-18' 57 | 1.2.1: 58 | changes: 59 | major_changes: 60 | - Removed dependency on Requests library for Python on the control node. 61 | release_date: '2022-08-31' 62 | 1.3.0: 63 | changes: 64 | major_changes: 65 | - Added new roles for z/OSMF Software Management 66 | objects: 67 | role: 68 | - description: Role to determine if a software instance is missing critical 69 | software updates 70 | name: zmf_swmgmt_identify_missing_critical_updates 71 | namespace: null 72 | - description: Role to determine if a software instance is missing updates 73 | for fix categories 74 | name: zmf_swmgmt_identify_missing_fixcat_updates 75 | namespace: null 76 | - description: Role to to search a software instance for one 77 | or more software updates 78 | name: zmf_swmgmt_search_software_updates 79 | namespace: null 80 | release_date: '2023-02-11' 81 | 1.4.0: 82 | changes: 83 | major_changes: 84 | - Added new roles for z/OS Management Services Catalog 85 | minor_changes: 86 | - Updated module `zmf_workflow` which returns the failed step if the 87 | workflow is not completed. 88 | objects: 89 | role: 90 | - description: Role runs a z/OS Management Service 91 | name: zmf_zmsc_run_management_service 92 | namespace: null 93 | release_date: '2023-05-15' 94 | 1.4.1: 95 | changes: 96 | minor_changes: 97 | - Documentation updates 98 | - Fixed ansible-lint issues 99 | release_date: '2023-12-21' 100 | 1.4.2: 101 | changes: 102 | minor_changes: 103 | - The README has been updated with a new template. 104 | - Fixed role `zmf_workflow_complete` which previously failed to return final_result. 105 | release_date: '2024-06-01' 106 | 1.5.0: 107 | changes: 108 | major_changes: 109 | - Added new roles for z/OSMF Software Management 110 | minor_changes: 111 | - Updated the z/OSMF Software Management roles from a previous release to support UUID 112 | objects: 113 | role: 114 | - description: Role queries a SMP/E global zone CSI data set 115 | name: ibm.ibm_zosmf.zmf_swmgmt_csi_query 116 | namespace: null 117 | - description: Role determines a z/OS system's UUID 118 | name: ibm.ibm_zosmf.zmf_swmgmt_system_uuid 119 | namespace: null 120 | release_date: '2024-06-07' 121 | -------------------------------------------------------------------------------- /changelogs/config.yaml: -------------------------------------------------------------------------------- 1 | changelog_filename_template: ../CHANGELOG.rst 2 | changelog_filename_version_depth: 0 3 | changes_file: changelog.yaml 4 | changes_format: combined 5 | ignore_other_fragment_extensions: true 6 | keep_fragments: false 7 | mention_ancestor: true 8 | new_plugins_after_name: removed_features 9 | notesdir: fragments 10 | prelude_section_name: release_summary 11 | prelude_section_title: Release Summary 12 | sanitize_changelog: true 13 | sections: 14 | - - major_changes 15 | - Major Changes 16 | - - minor_changes 17 | - Minor Changes 18 | - - breaking_changes 19 | - Breaking Changes / Porting Guide 20 | - - deprecated_features 21 | - Deprecated Features 22 | - - removed_features 23 | - Removed Features (previously deprecated) 24 | - - security_fixes 25 | - Security Fixes 26 | - - bugfixes 27 | - Bugfixes 28 | - - known_issues 29 | - Known Issues 30 | title: Ibm.Ibm_Zosmf 31 | trivial_section_name: trivial 32 | use_fqcn: true 33 | -------------------------------------------------------------------------------- /docs/ansible_content.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | ========== 6 | IBM z/OSMF 7 | ========== 8 | 9 | The **IBM z/OS Management Facility (z/OSMF) collection**, also represented as 10 | `ibm_zosmf`_ in this document, is part of the broader initiative to bring 11 | Ansible Automation to IBM Z® through the offering 12 | **Red Hat® Ansible Certified Content for IBM Z**. 13 | 14 | The **IBM z/OSMF collection** supports automation tasks such as operating z/OS 15 | workflows, provisioning and managing z/OS middlewares/softwares, via z/OSMF 16 | RESTful services. 17 | 18 | .. _ibm_zosmf: 19 | https://galaxy.ansible.com/ui/repo/published/ibm/ibm_zosmf 20 | 21 | .. toctree:: 22 | :maxdepth: 1 23 | :caption: Collection Content 24 | 25 | source/modules 26 | source/roles 27 | -------------------------------------------------------------------------------- /docs/source/community_guides.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | ============ 6 | Contributing 7 | ============ 8 | 9 | We are not currently accepting community contributions. 10 | However, we encourage you to open `git issues`_ for bugs, comments or feature 11 | requests. 12 | 13 | Review this content periodically to learn when and how to make 14 | contributions in the future. 15 | For the latest information on open issues, see: `git issues`_. 16 | 17 | 18 | .. _git issues: 19 | https://github.com/IBM/ibm_zosmf/issues 20 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | IBM z/OS Management Facility Collection 6 | ======================================= 7 | 8 | The **IBM z/OS Management Facility (z/OSMF) collection**, also represented as 9 | **ibm_zosmf** in this document, is part of the broader initiative to bring 10 | Ansible Automation to IBM Z® through the offering 11 | **Red Hat® Ansible Certified Content for IBM Z**. 12 | 13 | The **IBM z/OSMF collection** supports automation tasks such as operating z/OS 14 | workflows, provisioning and managing z/OS middlewares/softwares, via z/OSMF 15 | RESTful services. 16 | 17 | Red Hat Ansible Certified Content for IBM Z 18 | =========================================== 19 | 20 | The **Red Hat® Ansible Certified Content for IBM Z** provides the ability to 21 | connect IBM Z® to clients' wider enterprise automation strategy through the 22 | Ansible Automation Platform ecosystem. This enables development and operations 23 | automation on Z through a seamless, unified workflow orchestration with 24 | configuration management, provisioning, and application deployment in one 25 | easy-to-use platform. 26 | 27 | The **IBM z/OSMF collection**, as part of the broader offering 28 | **Red Hat® Ansible Certified Content for IBM Z**, will be available on both 29 | Galaxy as a community supported offering and on Automation Hub with enterprise 30 | support. 31 | 32 | Features 33 | ======== 34 | 35 | The **IBM z/OSMF collection** includes `modules`_, `roles`_ and ansible-doc to 36 | automate tasks on z/OS. 37 | 38 | .. toctree:: 39 | :maxdepth: 1 40 | :caption: Getting Started 41 | 42 | installation 43 | requirements-single 44 | playbooks 45 | 46 | .. toctree:: 47 | :maxdepth: 1 48 | :caption: Ansible Content 49 | 50 | modules 51 | roles 52 | 53 | .. toctree:: 54 | :maxdepth: 1 55 | :caption: Release Notes 56 | 57 | release_notes 58 | 59 | .. toctree:: 60 | :maxdepth: 1 61 | :caption: Reference 62 | 63 | resources 64 | community_guides 65 | license 66 | 67 | 68 | .. _modules: 69 | https://github.com/IBM/ibm_zosmf/tree/master/plugins/modules/ 70 | .. _roles: 71 | https://github.com/IBM/ibm_zosmf/tree/master/roles/ -------------------------------------------------------------------------------- /docs/source/installation.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | ============ 6 | Installation 7 | ============ 8 | 9 | You have multiple options to install an Ansible collection, depending on your 10 | requirements. 11 | Review the requirements to determine the appropriate installation option 12 | that is right for your environment. 13 | 14 | You can install the **IBM z/OSMF collection** using one of these options: 15 | 16 | #. Ansible Galaxy 17 | #. Ansible Automation Hub 18 | #. Local build 19 | 20 | Refer to the RedHat Ansible Certified Content documentation for more on the 21 | `installation`_. 22 | 23 | 24 | .. _installation: 25 | https://ibm.github.io/z_ansible_collections_doc/installation/installation.html -------------------------------------------------------------------------------- /docs/source/license.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | License 6 | ======= 7 | 8 | This collection is licensed under `Apache License, Version 2.0`_. 9 | 10 | 11 | .. _Apache License, Version 2.0: 12 | https://opensource.org/licenses/Apache-2.0 13 | -------------------------------------------------------------------------------- /docs/source/modules.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | Modules 6 | ======= 7 | 8 | Modules can be used from the command line or in a playbook task. 9 | Ansible executes each module, usually on the remote target node, and collects 10 | return values. 11 | While different modules perform different tasks, their interfaces and 12 | responses follow similar patterns. 13 | 14 | You can also access the documentation of each module from the command line by 15 | using the `ansible-doc`_ command: 16 | 17 | .. code-block:: sh 18 | 19 | $ ansible-doc ibm.ibm_zosmf.zmf_workflow 20 | $ ansible-doc ibm.ibm_zosmf.zmf_sca 21 | 22 | The **IBM z/OSMF collection** provides several modules. 23 | Reference material for each module contains documentation on what parameters 24 | certain modules accept, what values they expect those parameters to be, and 25 | what will returned. 26 | 27 | .. toctree:: 28 | :maxdepth: 1 29 | :glob: 30 | 31 | modules/* 32 | 33 | 34 | .. _ansible-doc: 35 | https://docs.ansible.com/ansible/latest/cli/ansible-doc.html#ansible-doc 36 | -------------------------------------------------------------------------------- /docs/source/modules/zmf_authenticate.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/modules/zmf_authenticate.py 3 | 4 | .. _zmf_authenticate_module: 5 | 6 | 7 | zmf_authenticate -- Authenticate with z/OSMF server 8 | =================================================== 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - Authenticate with z/OSMF server by either username/password or HTTPS client authenticate. 19 | 20 | - Return the authentication credentials for successful authentication. 21 | - The credential can be then used for succeeding Ansible tasks which call z/OSMF Ansible module or role. 22 | 23 | 24 | 25 | 26 | 27 | Parameters 28 | ---------- 29 | 30 | 31 | 32 | 33 | zmf_host 34 | Hostname of the z/OSMF server. 35 | 36 | | **required**: True 37 | | **type**: str 38 | 39 | 40 | 41 | 42 | zmf_port 43 | Port number of the z/OSMF server. 44 | 45 | | **required**: False 46 | | **type**: int 47 | 48 | 49 | 50 | 51 | zmf_user 52 | User name to be used for authenticating with z/OSMF server. 53 | 54 | Required when *zmf_crt* and *zmf_key* are not supplied. 55 | 56 | If *zmf_crt* and *zmf_key* are supplied, *zmf_user* and *zmf_password* are ignored. 57 | 58 | 59 | | **required**: False 60 | | **type**: str 61 | 62 | 63 | 64 | 65 | zmf_password 66 | Password to be used for authenticating with z/OSMF server. 67 | 68 | Required when *zmf_crt* and *zmf_key* are not supplied. 69 | 70 | If *zmf_crt* and *zmf_key* are supplied, *zmf_user* and *zmf_password* are ignored. 71 | 72 | 73 | | **required**: False 74 | | **type**: str 75 | 76 | 77 | 78 | 79 | zmf_crt 80 | Location of the PEM-formatted certificate chain file to be used for HTTPS client authentication. 81 | 82 | 83 | Required when *zmf_user* and *zmf_password* are not supplied. 84 | 85 | | **required**: False 86 | | **type**: str 87 | 88 | 89 | 90 | 91 | zmf_key 92 | Location of the PEM-formatted file with your private key to be used for HTTPS client authentication. 93 | 94 | 95 | Required when *zmf_user* and *zmf_password* are not supplied. 96 | 97 | | **required**: False 98 | | **type**: str 99 | 100 | 101 | 102 | 103 | Examples 104 | -------- 105 | 106 | .. code-block:: yaml+jinja 107 | 108 | 109 | - name: Authenticate with z/OSMF server by username/password 110 | zmf_authenticate: 111 | zmf_host: "sample.ibm.com" 112 | zmf_user: "your_username" 113 | zmf_password: "your_password" 114 | 115 | - name: Authenticate with z/OSMF server by HTTPS client authenticate 116 | zmf_authenticate: 117 | zmf_host: "sample.ibm.com" 118 | zmf_crt: "/file_with_your_certificate_chain.crt" 119 | zmf_key: "/file_with_your_private_key.key" 120 | 121 | - name: Authenticate with z/OSMF server by prompting to input username/password 122 | vars_prompt: 123 | - name: zmf_user 124 | prompt: "Enter your zOSMF username" 125 | private: false 126 | - name: zmf_password 127 | prompt: "Enter your zOSMF password" 128 | private: true 129 | tasks: 130 | - zmf_authenticate: 131 | zmf_host: "{{ zmf_host }}" 132 | zmf_port: "{{ zmf_port }}" 133 | zmf_user: "{{ zmf_user }}" 134 | zmf_password: "{{ zmf_password }}" 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | Return Values 145 | ------------- 146 | 147 | 148 | changed 149 | Indicates if any change is made during the module operation. 150 | 151 | | **returned**: always 152 | | **type**: bool 153 | 154 | ltpa_token_2 155 | The value of Lightweight Third Party Access (LTPA) token, which supports strong encryption. 156 | 157 | 158 | | **returned**: on success 159 | | **type**: str 160 | | **sample**: yDS7uJxqrd3h8v5WXq9pf1yPtztQ4JzroZN3XQKF26ZicXgHc7mdzgycMCa...... 161 | 162 | 163 | jwt_token 164 | The value of JSON Web token, which supports strong encryption. 165 | 166 | | **returned**: on success 167 | | **type**: str 168 | | **sample**: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ0b2tlmVhcmVyIiwicie...... 169 | 170 | 171 | zmf_host 172 | Hostname of the z/OSMF server. 173 | 174 | | **returned**: on success 175 | | **type**: str 176 | 177 | zmf_port 178 | Port number of the z/OSMF server. 179 | 180 | | **returned**: on success 181 | | **type**: int 182 | 183 | -------------------------------------------------------------------------------- /docs/source/playbooks.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | ========= 6 | Playbooks 7 | ========= 8 | 9 | An `Ansible playbook`_ consists of organized instructions that define work for 10 | a managed node (host) to be managed with Ansible. 11 | 12 | There are many playbooks available in the `samples repository`_ contributed by 13 | the Red Hat Ansible Certified Content for IBM Z team. 14 | The Git samples repository contain playbooks that demonstrate various topics. 15 | 16 | Refer to the RedHat Ansible Certified Content documentation for more on the 17 | `playbooks`_. 18 | 19 | 20 | .. _Ansible playbook: 21 | https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#playbooks-intro 22 | .. _samples repository: 23 | https://github.com/IBM/z_ansible_collections_samples/blob/master/README.md 24 | .. _playbooks: 25 | https://ibm.github.io/z_ansible_collections_doc/playbooks/playbooks.html -------------------------------------------------------------------------------- /docs/source/requirements.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | ============ 6 | Requirements 7 | ============ 8 | 9 | The **IBM z/OSMF collection** requires both a **control node** and 10 | **managed node** be configured with a minimum set of requirements. 11 | The control node is often referred to as the **controller** and the managed 12 | node as the **host** or **target**. 13 | 14 | Refer to RedHat Ansible Certified Content documentation for more on the 15 | `controllers dependencies`_. 16 | 17 | .. _controllers dependencies: 18 | https://ibm.github.io/z_ansible_collections_doc/requirements/requirements.html#control-node 19 | 20 | 21 | .. toctree:: 22 | :maxdepth: 3 23 | 24 | requirements_control 25 | requirements_managed -------------------------------------------------------------------------------- /docs/source/requirements_control.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | Control node 6 | ============ 7 | 8 | When using the **IBM z/OS Management Facility (z/OSMF) collection**, there 9 | is no additional requirements for the control node. 10 | -------------------------------------------------------------------------------- /docs/source/requirements_managed.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2023 . 3 | .. ........................................................................... 4 | 5 | Managed node 6 | ============ 7 | 8 | The managed z/OS node is the host that is managed by Ansible, as identified in 9 | the Ansible inventory. 10 | The managed node has dependencies that are specific to each release of the 11 | **IBM z/OSMF collection**. 12 | Review the details of the dependencies before you proceed to install the 13 | **IBM z/OSMF collection**. 14 | 15 | * `z/OS`_: V2R3 or later 16 | 17 | The target z/OS systems should be configured as the target hosts 18 | (managed nodes) in your playbook. 19 | The z/OSMF collection drives z/OSMF REST APIs remotely by default. 20 | This is done by specifying ``delegate_to: localhost`` statement in your 21 | playbook or roles in this collection. 22 | With this remote approach, it is not necessary to set up SSH and install 23 | Python on the target z/OS systems. 24 | 25 | * `z/OSMF server`_ 26 | 27 | The z/OSMF server must be installed and active on **at least one** z/OS 28 | system in the same sysplex. 29 | Information about the z/OSMF server must be configured in the inventory 30 | file or in the ``vars`` file, such as the hostname, port number, and 31 | authentication info. 32 | The authentication info to connect to the z/OSMF server is provided when 33 | running playbook or it will be prompted during playbook run. 34 | You can specify the same z/OSMF server for multiple z/OS managed nodes in 35 | the same sysplex. 36 | 37 | * `z/OSMF Workflow`_ 38 | 39 | z/OSMF Workflow is a plugin of z/OSMF which provides a framework to 40 | streamline z/OS tasks. 41 | To interact with z/OSMF Workflow in your playbook, it requires you to 42 | setup z/OSMF Workflow properly in z/OS managed nodes. 43 | Typically, you setup z/OSMF Workflow as a plugin of one z/OSMF server in 44 | each sysplex. 45 | 46 | This dependency is only required for using the following roles or modules: 47 | 48 | * module: `zmf_workflow`_ 49 | * role: `zmf_workflow_complete`_ 50 | * role: `zmf_cpm_provision_software_service`_ 51 | * role: `zmf_cpm_manage_software_instance`_ 52 | * role: `zmf_cpm_remove_software_instance`_ 53 | 54 | * `Cloud Provisioning and Management`_ (Optional) 55 | 56 | Cloud Provisioning and Management (CP&M) can be used to provision and 57 | Manage z/OS Software Instances. 58 | To interact with CP&M in your playbook, it requires you to set up CP&M 59 | properly in z/OS managed nodes. 60 | Typically, you setup CP&M as a plugin of one z/OSMF server in each sysplex. 61 | 62 | This dependency is only required for using the following roles or modules: 63 | 64 | * role: `zmf_cpm_provision_software_service`_ 65 | * role: `zmf_cpm_manage_software_instance`_ 66 | * role: `zmf_cpm_remove_software_instance`_ 67 | * role: `zmf_cpm_list_software_templates`_ 68 | * role: `zmf_cpm_create_software_instance`_ 69 | * role: `zmf_cpm_get_software_instance`_ 70 | 71 | * `z/OSMF SCA`_ 72 | 73 | z/OSMF SCA is a plugin of z/OSMF which supports json format of security descriptor file. 74 | This file can be used to document security requirements by function or product. 75 | With the security descriptor file which is easy to create, 76 | SCA is able to display and automatically validate or provision security requirements in a flexible granularity, 77 | either by individual requirement, by function or by product. SCA is based on SAF interface, 78 | therefore, supports all SAF based security products in most cases. 79 | 80 | To interact with z/OSMF SCA in your playbook, it requires you to 81 | setup z/OSMF SCA properly in z/OS managed nodes. 82 | 83 | This dependency is only required for using the following module: 84 | 85 | * module: `zmf_sca`_ 86 | 87 | * `z/OSMF Software Management`_ (Optional) 88 | 89 | To interact with the Software Management software instance maintenance reports in your playbook, 90 | it requires you to set up Software Management properly in z/OS managed nodes. 91 | Typically, you setup Software Management as a plugin of one z/OSMF server in each sysplex. 92 | 93 | This dependency is only required for using the following roles: 94 | 95 | * role: `zmf_swmgmt_identify_missing_critical_updates`_ 96 | * role: `zmf_swmgmt_identify_missing_fixcat_updates`_ 97 | * role: `zmf_swmgmt_search_software_updates`_ 98 | 99 | * `z/OS Management Services Catalog`_ (Optional) 100 | 101 | z/OS Management Services Catalog (zMSC) can be used to create, 102 | manage and run z/OS System Management Services. 103 | To interact with zMSC in your playbook, it requires you to set up 104 | z/OS Management Services Catalog properly in z/OS managed nodes. 105 | 106 | This dependency is only required for using the following roles: 107 | 108 | * role: `zmf_zmsc_run_management_service`_ 109 | 110 | .. _z/OS: 111 | https://www.ibm.com/support/knowledgecenter/SSLTBW_2.3.0/com.ibm.zos.v2r3/en/homepage.html 112 | .. _z/OSMF server: 113 | https://www.ibm.com/support/knowledgecenter/SSLTBW_2.3.0/com.ibm.zos.v2r3.izua300/abstract.html 114 | .. _z/OSMF Workflow: 115 | https://www.ibm.com/docs/en/zos/2.4.0?topic=services-configure-zosmf-workflows-task 116 | .. _Cloud Provisioning and Management: 117 | https://www.ibm.com/support/z-content-solutions/cloud-provisioning 118 | .. _zmf_workflow: 119 | modules/zmf_workflow.html 120 | .. _zmf_workflow_complete: 121 | roles/zmf_workflow_complete.html 122 | .. _zmf_cpm_provision_software_service: 123 | roles/zmf_cpm_provision_software_service.html 124 | .. _zmf_cpm_manage_software_instance: 125 | roles/zmf_cpm_manage_software_instance.html 126 | .. _zmf_cpm_remove_software_instance: 127 | roles/zmf_cpm_remove_software_instance.html 128 | .. _zmf_cpm_list_software_templates: 129 | roles/zmf_cpm_list_software_templates.html 130 | .. _zmf_cpm_create_software_instance: 131 | roles/zmf_cpm_create_software_instance.html 132 | .. _zmf_cpm_get_software_instance: 133 | roles/zmf_cpm_get_software_instance.html 134 | .. _z/OSMF SCA: 135 | https://www.ibm.com/docs/en/zos/2.4.0?topic=services-configure-zosmf-workflows-task 136 | .. _zmf_sca: 137 | modules/zmf_sca.html 138 | .. _z/OSMF Software Management: 139 | https://www.ibm.com/docs/en/zos/2.4.0?topic=services-configure-software-management-service 140 | .. _zmf_swmgmt_identify_missing_critical_updates: 141 | roles/zmf_swmgmt_identify_missing_critical_updates.html 142 | .. _zmf_swmgmt_identify_missing_fixcat_updates: 143 | roles/zmf_swmgmt_identify_missing_fixcat_updates.html 144 | .. _zmf_swmgmt_search_software_updates: 145 | roles/zmf_swmgmt_search_software_updates.html 146 | .. _z/OS Management Services Catalog: 147 | https://www.ibm.com/support/z-content-solutions/management-services/ 148 | .. _zmf_zmsc_run_management_service: 149 | roles/zmf_zmsc_run_management_service.html -------------------------------------------------------------------------------- /docs/source/resources.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | ========= 6 | Resources 7 | ========= 8 | 9 | * `IBM z/OS V2R3 Documentation`_ 10 | * `IBM z/OSMF V2R3 Documentation`_ 11 | * `IBM z/OSMF One Stop Hub`_ 12 | * `Workflows Open Repository`_ 13 | * `Cloud Provisioning and Management`_ 14 | 15 | .. _IBM z/OS V2R3 Documentation: 16 | https://www.ibm.com/support/knowledgecenter/SSLTBW_2.3.0/com.ibm.zos.v2r3/en/homepage.html 17 | .. _IBM z/OSMF V2R3 Documentation: 18 | https://www.ibm.com/support/knowledgecenter/SSLTBW_2.3.0/com.ibm.zos.v2r3.izua300/abstract.html 19 | .. _IBM z/OSMF One Stop Hub: 20 | https://ibm.github.io/zOSMF/ 21 | .. _Workflows Open Repository: 22 | https://www.openmainframeproject.org/projects/zorow 23 | .. _Cloud Provisioning and Management: 24 | https://www.ibm.com/support/z-content-solutions/cloud-provisioning -------------------------------------------------------------------------------- /docs/source/roles.rst: -------------------------------------------------------------------------------- 1 | .. ........................................................................... 2 | .. © Copyright IBM Corporation 2021 . 3 | .. ........................................................................... 4 | 5 | Roles 6 | ======= 7 | 8 | Roles are ways of automatically loading certain vars_files, tasks, and 9 | handlers based on a known file structure. 10 | Grouping content by roles also allows easy sharing of roles with other users. 11 | 12 | The **IBM z/OSMF collection** provides several roles. 13 | Reference material for each role contains documentation on how to use certain 14 | roles in your playbook. 15 | 16 | .. toctree:: 17 | :maxdepth: 1 18 | :glob: 19 | 20 | roles/* 21 | -------------------------------------------------------------------------------- /docs/source/roles/zmf_cpm_get_software_instance.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/roles/zmf_cpm_get_software_instance 3 | 4 | .. _zmf_cpm_get_software_instance_module: 5 | 6 | 7 | zmf_cpm_get_software_instance -- Role get specific z/OS software instance 8 | ========================================================================= 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - The **IBM z/OSMF collection** provides an Ansible role, referred to as **zmf_cpm_get_software_instance**, to obtain a specific software instance defined in the **IBM Cloud Provisioning and Management (CP&M**) software instances registry. 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Variables 27 | --------- 28 | 29 | 30 | 31 | 32 | zmf_host 33 | Hostname of the z/OSMF server, specified in the inventory file or vars file. 34 | 35 | 36 | | **required**: True 37 | | **type**: str 38 | 39 | 40 | 41 | 42 | zmf_port 43 | Port number of the z/OSMF server. If z/OSMF is not using the default port, you need to specify value for this parameter in the inventory file or vars file. 44 | 45 | 46 | | **required**: False 47 | | **type**: str 48 | | **default**: 443 49 | 50 | 51 | 52 | 53 | zmf_user 54 | User name to be used for authenticating with the z/OSMF server. 55 | 56 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 57 | 58 | 59 | | **required**: True 60 | | **type**: str 61 | 62 | 63 | 64 | 65 | zmf_password 66 | Password to be used for authenticating with z/OSMF server. 67 | 68 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 69 | 70 | 71 | | **required**: True 72 | | **type**: str 73 | 74 | 75 | 76 | 77 | instance_record_dir 78 | Directory path that the provisioning role uses to record the software instance and associated data (in JSON format). 79 | 80 | 81 | On many system default value ``"/tmp"`` used for this variable may not be acceptable because ``"/tmp"`` directory can be transient on the system. In such cases it is recommended to specify non-default value for this variable. This variable can be specified in the inventory file or vars file. 82 | 83 | 84 | | **required**: False 85 | | **type**: str 86 | | **default**: /tmp 87 | 88 | 89 | 90 | 91 | external_name 92 | The external name associated with the previously created software instance in Cloud Provisioning and Management software registry. 93 | 94 | 95 | | **required**: True 96 | | **type**: str 97 | 98 | 99 | 100 | 101 | Examples 102 | -------- 103 | 104 | .. code-block:: yaml+jinja 105 | 106 | 107 | - name: sample of retrieving software instance from registry 108 | hosts: sampleHost 109 | gather_facts: no 110 | collections: 111 | - ibm.ibm_zosmf 112 | 113 | vars: 114 | - name: instance_info_json_path 115 | 116 | tasks: 117 | - include_module: 118 | name: zmf_cpm_get_software_instance 119 | vars: 120 | external_software_name: "" 121 | 122 | - name: Obtain Variable Value 123 | vars: 124 | instance_info_json: "{{lookup('file', instance_info_json_path)}}" 125 | 126 | set_fact: 127 | 128 | VAR1: "{{ instance_info_json['registry-info'] | json_query('variables[?name == ``]') | join(' ') }}" 129 | 130 | - name: Display VAR1 value 131 | debug: 132 | msg: "VAR1 Value is : {{ VAR1.value }}" 133 | 134 | 135 | 136 | 137 | Notes 138 | ----- 139 | 140 | .. note:: 141 | - The given example assumes that you have an inventory file *inventory.yml* and host vars *sampleHost.yml* with appropriate values to identify the target z/OSMF server end point. 142 | 143 | 144 | - When playbooks completes, a message shown in following example is displayed, ``"msg": "Instance record saved at: /tmp/xxx/xxx.json"``. This message includes a file path and file name where the instance specific data of of requested software instance is returned. User can obtain specific property from this file using json_query. 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /docs/source/roles/zmf_cpm_list_software_templates.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/roles/zmf_cpm_list_software_templates 3 | 4 | .. _zmf_cpm_list_software_templates_module: 5 | 6 | 7 | zmf_cpm_list_software_templates -- Role lists all published z/OS software templates 8 | =================================================================================== 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - The **IBM z/OSMF collection** provides an Ansible role, referred to as **zmf_cpm_list_software_templates**, to obtain list of all the published templates that can be used to provision z/OS middleware such as IBM Customer Information Control System (CICS®), IBM Db2®, IBM MQ, and IBM WebSphere Application Server or any other software service from **IBM Cloud Provisioning and Management (CP&M**) catalog. 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Variables 27 | --------- 28 | 29 | 30 | 31 | 32 | zmf_host 33 | Hostname of the z/OSMF server, specified in the inventory file or vars file. 34 | 35 | 36 | | **required**: True 37 | | **type**: str 38 | 39 | 40 | 41 | 42 | zmf_port 43 | Port number of the z/OSMF server. If z/OSMF is not using the default port, you need to specify value for this parameter in the inventory file or vars file. 44 | 45 | 46 | | **required**: False 47 | | **type**: str 48 | | **default**: 443 49 | 50 | 51 | 52 | 53 | zmf_user 54 | User name to be used for authenticating with the z/OSMF server. 55 | 56 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 57 | 58 | 59 | | **required**: True 60 | | **type**: str 61 | 62 | 63 | 64 | 65 | zmf_password 66 | Password to be used for authenticating with z/OSMF server. 67 | 68 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 69 | 70 | 71 | | **required**: True 72 | | **type**: str 73 | 74 | 75 | 76 | 77 | instance_record_dir 78 | Directory path that the provisioning role uses to capture list of published templates (in JSON format). 79 | 80 | 81 | On many system default value ``"/tmp"`` used for this variable may not be acceptable because ``"/tmp"`` directory can be transient on the system. In such cases it is recommended to specify non-default value for this variable. This variable can be specified in the inventory file or vars file. 82 | 83 | 84 | | **required**: False 85 | | **type**: str 86 | | **default**: /tmp 87 | 88 | 89 | 90 | 91 | Examples 92 | -------- 93 | 94 | .. code-block:: yaml+jinja 95 | 96 | 97 | - name: list published provisioning templates 98 | hosts: sampleHost 99 | gather_facts: no 100 | collections: 101 | - ibm.ibm_zosmf 102 | tasks: 103 | - include_module: 104 | name: zmf_cpm_list_software_templates 105 | 106 | 107 | 108 | 109 | Notes 110 | ----- 111 | 112 | .. note:: 113 | - The given example assumes that you have an inventory file *inventory.yml* and host vars *sampleHost.yml* with appropriate values to identify the target z/OSMF server end point. 114 | 115 | 116 | - When playbooks completes, a message shown in following example is displayed, ``"msg": "Published Template List saved at: /tmp/xxx.json"``. This message includes a file path and file name where the list of published template is returned. 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /docs/source/roles/zmf_cpm_manage_software_instance.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/roles/zmf_cpm_manage_software_instance 3 | 4 | .. _zmf_cpm_manage_software_instance_module: 5 | 6 | 7 | zmf_cpm_manage_software_instance -- Role manages a provisioned z/OS software instance 8 | ===================================================================================== 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - The **IBM z/OSMF collection** provides an Ansible role, referred to as **zmf_cpm_manage_software_instance**, to manage a provisioned instance of z/OS middleware such as IBM Customer Information Control System (CICS®), IBM Db2®, IBM Information Management System (IMS™), IBM MQ, and IBM WebSphere Application Server or any other software service. 19 | 20 | - Depending on actions supported by z/OS middleware or software, various management such as starting or stopping the instance can be performed by using this role. 21 | 22 | - When software service instance is not required any more, it can be deprovisioned by using this role. 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Variables 31 | --------- 32 | 33 | 34 | 35 | 36 | zmf_host 37 | Hostname of the z/OSMF server, specified in the inventory file or vars file. 38 | 39 | 40 | | **required**: True 41 | | **type**: str 42 | 43 | 44 | 45 | 46 | zmf_port 47 | Port number of the z/OSMF server. If z/OSMF is not using the default port, you need to specify value for this parameter in the inventory file or vars file. 48 | 49 | 50 | | **required**: False 51 | | **type**: str 52 | | **default**: 443 53 | 54 | 55 | 56 | 57 | zmf_user 58 | User name to be used for authenticating with the z/OSMF server. 59 | 60 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 61 | 62 | 63 | | **required**: True 64 | | **type**: str 65 | 66 | 67 | 68 | 69 | zmf_password 70 | Password to be used for authenticating with z/OSMF server. 71 | 72 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 73 | 74 | 75 | | **required**: True 76 | | **type**: str 77 | 78 | 79 | 80 | 81 | instance_action_name 82 | Action to be performed on a provisioned software instance, for example, ``Deprovision``. 83 | 84 | 85 | Actions that can be performed on a provisioned instance are described in local record file that is associated with the provisioned instance. The *name* variable in *actions* array under *registry-info* identifies the various actions that can be performed on the instance. 86 | 87 | 88 | | **required**: True 89 | | **type**: str 90 | 91 | 92 | 93 | 94 | instance_info_json_path 95 | Directory path for the JSON file that holds provisioned instance information. 96 | 97 | 98 | Specify the file name that was generated when the :ref:`zmf_cpm_provision_software_service ` role was performed. 99 | 100 | 101 | | **required**: True 102 | | **type**: str 103 | 104 | 105 | 106 | 107 | input_vars 108 | Input variable names and values for the action to be performed on the provisioned instance. 109 | 110 | 111 | This variable is required if the action processing expects specific inputs from user. This is a dictionary variable and needs to be in following format, ``[{ "name":"VAR1","value":"VAR1_VALUE"},{..},...]`` 112 | 113 | 114 | | **required**: False 115 | | **type**: dict 116 | 117 | 118 | 119 | 120 | api_polling_retry_count 121 | Total retry attempts allowed before the role exits with failure, waiting on the instance action to complete. 122 | 123 | 124 | This variable can be specified in the inventory file or vars file. 125 | 126 | 127 | | **required**: False 128 | | **type**: int 129 | | **default**: 50 130 | 131 | 132 | 133 | 134 | api_polling_interval_seconds 135 | Interval time (in seconds) for each polling request. 136 | 137 | 138 | This variable can be specified in the inventory file or vars file. 139 | 140 | 141 | | **required**: False 142 | | **type**: int 143 | | **default**: 10 144 | 145 | 146 | 147 | 148 | Examples 149 | -------- 150 | 151 | .. code-block:: yaml+jinja 152 | 153 | 154 | - name: Perform action on provisioned instance of z/OS Middleware 155 | hosts: sampleHost 156 | gather_facts: no 157 | collections: 158 | - ibm.ibm_zosmf 159 | tasks: 160 | - include_module: 161 | name: zmf_cpm_manage_software_instance 162 | vars: 163 | instance_action_name: "" 164 | instance_info_json_path: "" 165 | input_vars: '' 166 | 167 | 168 | 169 | Notes 170 | ----- 171 | 172 | .. note:: 173 | - The given example assumes that you have an inventory file *inventory.yml* and host vars *sampleHost.yml* with appropriate values to identify the target z/OSMF server end point. 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /docs/source/roles/zmf_cpm_provision_software_service.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/roles/zmf_cpm_provision_software_service 3 | 4 | .. _zmf_cpm_provision_software_service_module: 5 | 6 | 7 | zmf_cpm_provision_software_service -- Role provisions a z/OS software service 8 | ============================================================================= 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - The **IBM z/OSMF collection** provides an Ansible role, referred to as **zmf_cpm_provision_software_service**, to provision a z/OS middleware such as IBM Customer Information Control System (CICS®), IBM Db2®, IBM Information Management System (IMS™), IBM MQ, and IBM WebSphere Application Server or any other software service by using an **IBM Cloud Provisioning and Management (CP&M**) template. 19 | 20 | - Template referenced by playbook must be published in *z/OSMF Software Services Catalog*. 21 | 22 | - This role will generate a unique JSON file that holds provisioned instance information. The file location is in following format, ``/-.json`` 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Variables 31 | --------- 32 | 33 | 34 | 35 | 36 | zmf_host 37 | Hostname of the z/OSMF server, specified in the inventory file or vars file. 38 | 39 | 40 | | **required**: True 41 | | **type**: str 42 | 43 | 44 | 45 | 46 | zmf_port 47 | Port number of the z/OSMF server. If z/OSMF is not using the default port, you need to specify value for this parameter in the inventory file or vars file. 48 | 49 | 50 | | **required**: False 51 | | **type**: str 52 | | **default**: 443 53 | 54 | 55 | 56 | 57 | zmf_user 58 | User name to be used for authenticating with the z/OSMF server. 59 | 60 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 61 | 62 | 63 | | **required**: True 64 | | **type**: str 65 | 66 | 67 | 68 | 69 | zmf_password 70 | Password to be used for authenticating with z/OSMF server. 71 | 72 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 73 | 74 | 75 | | **required**: True 76 | | **type**: str 77 | 78 | 79 | 80 | 81 | instance_record_dir 82 | Directory path that the provisioning role uses to capture various information (in JSON format) about the provisioned instance. 83 | 84 | 85 | On many system default value ``"/tmp"`` used for this variable may not be acceptable because ``"/tmp"`` directory can be transient on the system. In such cases it is recommended to specify non-default value for this variable. This variable can be specified in the inventory file or vars file. 86 | 87 | 88 | | **required**: False 89 | | **type**: str 90 | | **default**: /tmp 91 | 92 | 93 | 94 | 95 | cpm_template_name 96 | Template name for the software service to be provisioned. 97 | 98 | | **required**: True 99 | | **type**: str 100 | 101 | 102 | 103 | 104 | domain_name 105 | Cloud domain name that is associated with the template. 106 | 107 | | **required**: True 108 | | **type**: str 109 | 110 | 111 | 112 | 113 | tenant_name 114 | CP&M Tenant name that is associated with the user who is performing this role. 115 | 116 | 117 | This variable is required if *zmf_user* is associated with multiple CP&M tenants. 118 | 119 | 120 | | **required**: False 121 | | **type**: str 122 | 123 | 124 | 125 | 126 | systems_nicknames 127 | System nickname as specified in the z/OSMF Systems table. 128 | 129 | If this variable is not specified, provisioning is performed on the system where z/OSMF is currently running. 130 | 131 | 132 | | **required**: False 133 | | **type**: str 134 | 135 | 136 | 137 | 138 | input_vars 139 | Input variable names and values for the software service to be provisioned. 140 | 141 | 142 | This variable is required if software service expects specific inputs from user. This is a dictionary variable and needs to be in following format, ``[{ "name":"VAR1","value":"VAR1_VALUE"},{..},...]`` 143 | 144 | 145 | | **required**: False 146 | | **type**: dict 147 | 148 | 149 | 150 | 151 | zmf_body 152 | Instead of specifying *domain_name*, *tenant_name*, *system_nicknames* and *input_variable* individually, this parameter can be used to pass them as a dictionary variable. This variable needs to be in following format, 153 | 154 | 155 | ``{`` 156 | 157 | ``"domain-name":"{{ domain_name }}",`` 158 | 159 | ``"domain-name":"{{ domain_name }}",`` 160 | 161 | ``"systems-nicknames":["{{ systems_nicknames }}"],`` 162 | 163 | ``"input-variables":"{{ input_vars }}"`` 164 | 165 | ``}`` 166 | 167 | | **required**: False 168 | | **type**: dict 169 | 170 | 171 | 172 | 173 | api_polling_retry_count 174 | Total retry attempts allowed before the role exits with failure, waiting on the instance action to complete. 175 | 176 | 177 | This variable can be specified in the inventory file or vars file. 178 | 179 | 180 | | **required**: False 181 | | **type**: int 182 | | **default**: 50 183 | 184 | 185 | 186 | 187 | api_polling_interval_seconds 188 | Interval time (in seconds) for each polling request. 189 | 190 | 191 | This variable can be specified in the inventory file or vars file. 192 | 193 | 194 | | **required**: False 195 | | **type**: int 196 | | **default**: 10 197 | 198 | 199 | 200 | 201 | Examples 202 | -------- 203 | 204 | .. code-block:: yaml+jinja 205 | 206 | 207 | - name: Provision a z/OS Middleware service 208 | hosts: sampleHost 209 | gather_facts: no 210 | collections: 211 | - ibm.ibm_zosmf 212 | tasks: 213 | - include_module: 214 | name: zmf_cpm_provision_software_service 215 | vars: 216 | cpm_template_name: "" 217 | domain_name: "" 218 | tenant_name: "" 219 | systems_nicknames: "" 220 | input_vars: "" 221 | 222 | 223 | 224 | 225 | Notes 226 | ----- 227 | 228 | .. note:: 229 | - The given example assumes that you have an inventory file *inventory.yml* and host vars *sampleHost.yml* with appropriate values to identify the target z/OSMF server end point. 230 | 231 | 232 | - When playbooks completes, a message shown in following example is displayed, ``"msg": "Instance record saved at: /tmp/xxx.json"``. This message includes a file path and file name where instance specific information is returned. This file is required for :ref:`zmf_cpm_manage_software_instance ` and :ref:`zmf_cpm_remove_software_instance ` roles. 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | -------------------------------------------------------------------------------- /docs/source/roles/zmf_cpm_remove_software_instance.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/roles/zmf_cpm_remove_software_instance 3 | 4 | .. _zmf_cpm_remove_software_instance_module: 5 | 6 | 7 | zmf_cpm_remove_software_instance -- Role removes a z/OS software instance 8 | ========================================================================= 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - The **IBM z/OSMF collection** provides an Ansible role, referred to as **zmf_cpm_remove_software_instance**, to remove a deprovisioned instance of z/OS middleware such as IBM Customer Information Control System (CICS®), IBM Db2®, IBM Information Management System (IMS™), IBM MQ, and IBM WebSphere Application Server or any other software service from **IBM Cloud Provisioning and Management (CP&M**) registry. 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Variables 27 | --------- 28 | 29 | 30 | 31 | 32 | zmf_host 33 | Hostname of the z/OSMF server, specified in the inventory file or vars file. 34 | 35 | 36 | | **required**: True 37 | | **type**: str 38 | 39 | 40 | 41 | 42 | zmf_port 43 | Port number of the z/OSMF server. If z/OSMF is not using the default port, you need to specify value for this parameter in the inventory file or vars file. 44 | 45 | 46 | | **required**: False 47 | | **type**: str 48 | | **default**: 443 49 | 50 | 51 | 52 | 53 | zmf_user 54 | User name to be used for authenticating with the z/OSMF server. 55 | 56 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 57 | 58 | 59 | | **required**: True 60 | | **type**: str 61 | 62 | 63 | 64 | 65 | zmf_password 66 | Password to be used for authenticating with z/OSMF server. 67 | 68 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 69 | 70 | 71 | | **required**: True 72 | | **type**: str 73 | 74 | 75 | 76 | 77 | instance_info_json_path 78 | Directory path for the JSON file that holds provisioned instance information. 79 | 80 | 81 | Specify the file name that was generated when the :ref:`zmf_cpm_provision_software_service ` role was performed. 82 | 83 | 84 | | **required**: True 85 | | **type**: str 86 | 87 | 88 | 89 | 90 | Examples 91 | -------- 92 | 93 | .. code-block:: yaml+jinja 94 | 95 | 96 | - name: Remove deprovisioned instance of z/OS Middleware 97 | hosts: sampleHost 98 | gather_facts: no 99 | collections: 100 | - ibm.ibm_zosmf 101 | tasks: 102 | - include_module: 103 | name: zmf_cpm_remove_software_instance 104 | vars: 105 | instance_info_json_path: "" 106 | 107 | 108 | 109 | Notes 110 | ----- 111 | 112 | .. note:: 113 | - The given example assumes that you have an inventory file *inventory.yml* and host vars *sampleHost.yml* with appropriate values to identify the target z/OSMF server end point. 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /docs/source/roles/zmf_swmgmt_identify_missing_critical_updates.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/roles/zmf_swmgmt_identify_missing_critical_updates 3 | 4 | .. _zmf_swmgmt_identify_missing_critical_updates_module: 5 | 6 | 7 | zmf_swmgmt_identify_missing_critical_updates -- Identify Missing Critical Software Updates for a Software Instance 8 | ================================================================================================================== 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - The \ :strong:`IBM z/OSMF collection`\ provides an Ansible role, referred to as \ :strong:`zmf\_swmgmt\_identify\_missing\_critical\_updates`\ , to determine if a software instance is missing software updates to resolve PE PTFs, HIPER fixes, or other exception SYSMODs identified by ERROR HOLDDATA. It also helps you identify the SYSMODs that resolve those exceptions. 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Variables 27 | --------- 28 | 29 | 30 | 31 | 32 | zmf_host 33 | Hostname of the z/OSMF server, specified in the inventory file or as an argument on the playbook command. 34 | 35 | 36 | | **required**: True 37 | | **type**: str 38 | 39 | 40 | 41 | 42 | zmf_port 43 | Port number of the z/OSMF server. If z/OSMF is not using the default port, you need to specify a value for this parameter in the inventory file or as an argument on the playbook command. 44 | 45 | 46 | | **required**: False 47 | | **type**: str 48 | | **default**: 443 49 | 50 | 51 | 52 | 53 | zmf_user 54 | User ID for authenticating with the z/OSMF server. 55 | 56 | This variable can be specified in the inventory file or as an argument on the playbook command. 57 | 58 | 59 | | **required**: True 60 | | **type**: str 61 | 62 | 63 | 64 | 65 | zmf_password 66 | Password to be used for authenticating with z/OSMF server. 67 | 68 | This variable can be specified in the inventory file or as an argument on the playbook command. 69 | 70 | 71 | | **required**: True 72 | | **type**: str 73 | 74 | 75 | 76 | 77 | software_instance_name 78 | Name of the software instance. 79 | 80 | A software instance name must be specified when a software instance UUID is not specified. If both a software instance name and UUID are specified, then the software instance UUID is used by default. 81 | 82 | 83 | This variable can be specified in the inventory file or as an argument on the playbook command. 84 | 85 | 86 | | **required**: False 87 | | **type**: str 88 | 89 | 90 | 91 | 92 | system_nickname 93 | Nickname of the z/OSMF host system that has access to the volumes and data sets where the software instance resides. 94 | 95 | 96 | A system nickname must be specified when a software instance UUID is not specified. If a software instance UUID is specified in addition to a software instance and system nickname, then the software instance UUID is used by default. 97 | 98 | 99 | This variable can be specified in the inventory file or as an argument on the playbook command. 100 | 101 | 102 | | **required**: False 103 | | **type**: str 104 | 105 | 106 | 107 | 108 | software_instance_uuid 109 | A UUID of a software instance. A UUID is assigned to every software instance and can be obtained using the "List the software instances defined to z/OSMF" REST API. 110 | 111 | 112 | A UUID can also be obtained using the zmf\_swmgmt\_zos\_system\_uuid Ansible role which retrieves the UUID for the software instance that represents the installed software for the specified z/OSMF host system. 113 | 114 | 115 | A software instance UUID must be specified when a software instance name is not specified. If both a software instance UUID and name are specified, then the software instance UUID is used by default. 116 | 117 | 118 | This variable can be specified in the inventory file or as an argument on the playbook command. 119 | 120 | 121 | | **required**: False 122 | | **type**: str 123 | 124 | 125 | 126 | 127 | missing_critical_updates_response_file 128 | The path to the file that will contain the results from the missing critical updates operation. 129 | 130 | The directory must already exist otherwise there will be an error writing the results to the file. If the file exists in the directory already, it will be overwritten by the new response when the playbook is executed. If the file doesn't exist in the directory, it will be created. 131 | 132 | 133 | This variable can be specified in the inventory file or as an argument on the playbook command. 134 | 135 | 136 | | **required**: True 137 | | **type**: str 138 | 139 | 140 | 141 | 142 | remote_zmf_user 143 | User ID for authenticating with a remote z/OSMF server. Used only if the software instance resides on a remote z/OSMF server. 144 | 145 | 146 | | **required**: False 147 | | **type**: str 148 | 149 | 150 | 151 | 152 | remote_zmf_password 153 | Password for authenticating with a remote z/OSMF server. 154 | 155 | | **required**: False 156 | | **type**: str 157 | 158 | 159 | 160 | 161 | proxy_zmf_user 162 | User ID for authenticating with an HTTP proxy server. 163 | 164 | | **required**: False 165 | | **type**: str 166 | 167 | 168 | 169 | 170 | proxy_zmf_password 171 | Password for authenticating with an HTTP proxy server. 172 | 173 | | **required**: False 174 | | **type**: str 175 | 176 | 177 | 178 | 179 | Examples 180 | -------- 181 | 182 | .. code-block:: yaml+jinja 183 | 184 | 185 | - name: sample of identifying missing critical software updates for a software instance 186 | hosts: sampleHost 187 | gather_facts: no 188 | collections: 189 | - ibm.ibm_zosmf 190 | 191 | tasks: 192 | - include_role : 193 | name: zmf_swmgmt_identify_missing_critical_updates 194 | 195 | 196 | 197 | 198 | Notes 199 | ----- 200 | 201 | .. note:: 202 | - The given example assumes you have an inventory file \ :emphasis:`inventory.yml`\ that contains the values for the variables described above, such as z/OSMF host server, userid, password, software instance name and system, and response file name. 203 | 204 | 205 | - Command syntax to call a playbook using an inventory file: \ :literal:`ansible-playbook -i inventory software\_management\_reports\_CICDtest1.yml`\ 206 | 207 | 208 | - Command syntax to call a playbook using command arguments: \ :literal:`ansible-playbook software\_management\_reports\_CICDtest1.yml -e zmf\_user=zosmf\*\* -e zmf\_password=zosmf\*\*`\ 209 | 210 | 211 | - When the role is executed, a message shown in following example is displayed, \ :literal:`"msg": "Output filename= /tmp/xxx/missing\_critical\_updates\_response.json"`\ . This message includes a file path and file name where the missing critical updates report for the requested software instance is returned. 212 | 213 | 214 | - Refer to https://www.ibm.com/docs/en/zos/3.1.0?topic=services-missing-critical-updates for more information on the REST API's request and response JSON. 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | -------------------------------------------------------------------------------- /docs/source/roles/zmf_swmgmt_identify_missing_fixcat_updates.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/roles/zmf_swmgmt_identify_missing_fixcat_updates 3 | 4 | .. _zmf_swmgmt_identify_missing_fixcat_updates_module: 5 | 6 | 7 | zmf_swmgmt_identify_missing_fixcat_updates -- Identify Missing Fixcat Software Updates for a Software Instance 8 | ============================================================================================================== 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - The \ :strong:`IBM z/OSMF collection`\ provides an Ansible role, referred to as \ :strong:`zmf\_swmgmt\_identify\_missing\_fixcat\_updates`\ , to determine if a software instance is missing updates for fix categories that might be applicable to the software instance. It also helps you identify the SYSMODs that resolve the missing updates. 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Variables 27 | --------- 28 | 29 | 30 | 31 | 32 | zmf_host 33 | Hostname of the z/OSMF server, specified in the inventory file or as an argument on the playbook command. 34 | 35 | 36 | | **required**: True 37 | | **type**: str 38 | 39 | 40 | 41 | 42 | zmf_port 43 | Port number of the z/OSMF server. If z/OSMF is not using the default port, you need to specify a value for this parameter in the inventory file or as an argument on the playbook command. 44 | 45 | 46 | | **required**: False 47 | | **type**: str 48 | | **default**: 443 49 | 50 | 51 | 52 | 53 | zmf_user 54 | User ID for authenticating with the z/OSMF server. 55 | 56 | This variable can be specified in the inventory file or as an argument on the playbook command. 57 | 58 | 59 | | **required**: True 60 | | **type**: str 61 | 62 | 63 | 64 | 65 | zmf_password 66 | Password to be used for authenticating with z/OSMF server. 67 | 68 | This variable can be specified in the inventory file or as an argument on the playbook command. 69 | 70 | 71 | | **required**: True 72 | | **type**: str 73 | 74 | 75 | 76 | 77 | software_instance_name 78 | Name of the software instance. 79 | 80 | A software instance name must be specified when a software instance UUID is not specified. If both a software instance name and UUID are specified, then the software instance UUID is used by default. 81 | 82 | 83 | This variable can be specified in the inventory file or as an argument on the playbook command. 84 | 85 | 86 | | **required**: False 87 | | **type**: str 88 | 89 | 90 | 91 | 92 | system_nickname 93 | Nickname of the z/OSMF host system that has access to the volumes and data sets where the software instance resides. 94 | 95 | 96 | A system nickname must be specified when a software instance UUID is not specified. If a software instance UUID is specified in addition to a software instance and system nickname, then the software instance UUID is used by default. 97 | 98 | 99 | This variable can be specified in the inventory file or as an argument on the playbook command. 100 | 101 | 102 | | **required**: False 103 | | **type**: str 104 | 105 | 106 | 107 | 108 | software_instance_uuid 109 | A UUID of a software instance. A UUID is assigned to every software instance and can be obtained using the "List the software instances defined to z/OSMF" REST API. 110 | 111 | 112 | A UUID can also be obtained using the zmf\_swmgmt\_zos\_system\_uuid Ansible role which retrieves the UUID for the software instance that represents the installed software for the specified z/OSMF host system. 113 | 114 | 115 | A software instance UUID must be specified when a software instance name is not specified. If both a software instance UUID and name are specified, then the software instance UUID is used by default. 116 | 117 | 118 | This variable can be specified in the inventory file or as an argument on the playbook command. 119 | 120 | 121 | | **required**: False 122 | | **type**: str 123 | 124 | 125 | 126 | 127 | missing_fixcat_updates_response_file 128 | The path to the file that will contain the results from the missing fixcat updates operation. 129 | 130 | The directory must already exist otherwise there will be an error writing the results to the file. If the file exists in the directory already, it will be overwritten by the new response when the playbook is executed. If the file doesn't exist in the directory, it will be created. 131 | 132 | 133 | This variable can be specified in the inventory file or as an argument on the playbook command. 134 | 135 | 136 | | **required**: True 137 | | **type**: str 138 | 139 | 140 | 141 | 142 | remote_zmf_user 143 | User ID for authenticating with a remote z/OSMF server. Used only if the software instance resides on a remote z/OSMF server. 144 | 145 | 146 | | **required**: False 147 | | **type**: str 148 | 149 | 150 | 151 | 152 | remote_zmf_password 153 | Password for authenticating with a remote z/OSMF server. 154 | 155 | | **required**: False 156 | | **type**: str 157 | 158 | 159 | 160 | 161 | proxy_zmf_user 162 | User ID for authenticating with an HTTP proxy server. 163 | 164 | | **required**: False 165 | | **type**: str 166 | 167 | 168 | 169 | 170 | proxy_zmf_password 171 | Password for authenticating with an HTTP proxy server. 172 | 173 | | **required**: False 174 | | **type**: str 175 | 176 | 177 | 178 | 179 | Examples 180 | -------- 181 | 182 | .. code-block:: yaml+jinja 183 | 184 | 185 | - name: sample of identifying missing fixcat software updates for a software instance 186 | hosts: sampleHost 187 | gather_facts: no 188 | collections: 189 | - ibm.ibm_zosmf 190 | 191 | tasks: 192 | - include_role : 193 | name: zmf_swmgmt_identify_missing_fixcat_updates 194 | 195 | 196 | 197 | 198 | Notes 199 | ----- 200 | 201 | .. note:: 202 | - The given example assumes you have an inventory file \ :emphasis:`inventory.yml`\ that contains the values for the variables described above, such as z/OSMF host server, userid, password, software instance name and system, and response file name. 203 | 204 | 205 | - Command syntax to call a playbook using an inventory file: \ :literal:`ansible-playbook -i inventory software\_management\_reports\_CICDtest1.yml`\ 206 | 207 | 208 | - Command syntax to call a playbook using command arguments: \ :literal:`ansible-playbook software\_management\_reports\_CICDtest1.yml -e zmf\_user=zosmf\*\* -e zmf\_password=zosmf\*\*`\ 209 | 210 | 211 | - When the role is executed, a message shown in following example is displayed, \ :literal:`"msg": "Output filename= /tmp/xxx/missing\_fixcat\_updates\_response.json"`\ . This message includes a file path and file name where the missing fixcat updates report for the requested software instance is returned. 212 | 213 | 214 | - Refer to https://www.ibm.com/docs/en/zos/3.1.0?topic=services-missing-fixcat-updates for more information on the REST API's request and response JSON. 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | -------------------------------------------------------------------------------- /docs/source/roles/zmf_swmgmt_search_software_updates.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/roles/zmf_swmgmt_search_software_updates 3 | 4 | .. _zmf_swmgmt_search_software_updates_module: 5 | 6 | 7 | zmf_swmgmt_search_software_updates -- Search a Software Instance for Software Updates 8 | ===================================================================================== 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - The \ :strong:`IBM z/OSMF collection`\ provides an Ansible role, referred to as \ :strong:`zmf\_swmgmt\_search\_software\_updates`\ , to search a software instance for one or more software updates to determine which updates are installed or updates that need to be installed. 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Variables 27 | --------- 28 | 29 | 30 | 31 | 32 | zmf_host 33 | Hostname of the z/OSMF server, specified in the inventory file or as an argument on the playbook command. 34 | 35 | 36 | | **required**: True 37 | | **type**: str 38 | 39 | 40 | 41 | 42 | zmf_port 43 | Port number of the z/OSMF server. If z/OSMF is not using the default port, you need to specify a value for this parameter in the inventory file or as an argument on the playbook command. 44 | 45 | 46 | | **required**: False 47 | | **type**: str 48 | | **default**: 443 49 | 50 | 51 | 52 | 53 | zmf_user 54 | User ID for authenticating with the z/OSMF server. 55 | 56 | This variable can be specified in the inventory file or as an argument on the playbook command. 57 | 58 | 59 | | **required**: True 60 | | **type**: str 61 | 62 | 63 | 64 | 65 | zmf_password 66 | Password to be used for authenticating with z/OSMF server. 67 | 68 | This variable can be specified in the inventory file or as an argument on the playbook command. 69 | 70 | 71 | | **required**: True 72 | | **type**: str 73 | 74 | 75 | 76 | 77 | software_instance_name 78 | Name of the software instance. 79 | 80 | A software instance name must be specified when a software instance UUID is not specified. If both a software instance name and UUID are specified, then the software instance UUID is used by default. 81 | 82 | 83 | This variable can be specified in the inventory file or as an argument on the playbook command. 84 | 85 | 86 | | **required**: False 87 | | **type**: str 88 | 89 | 90 | 91 | 92 | system_nickname 93 | Nickname of the z/OSMF host system that has access to the volumes and data sets where the software instance resides. 94 | 95 | 96 | A system nickname must be specified when a software instance UUID is not specified. If a software instance UUID is specified in addition to a software instance and system nickname, then the software instance UUID is used by default. 97 | 98 | 99 | This variable can be specified in the inventory file or as an argument on the playbook command. 100 | 101 | 102 | | **required**: False 103 | | **type**: str 104 | 105 | 106 | 107 | 108 | software_instance_uuid 109 | A UUID of a software instance. A UUID is assigned to every software instance and can be obtained using the "List the software instances defined to z/OSMF" REST API. 110 | 111 | 112 | A UUID can also be obtained using the zmf\_swmgmt\_zos\_system\_uuid Ansible role which retrieves the UUID for the software instance that represents the installed software for the specified z/OSMF host system. 113 | 114 | 115 | A software instance UUID must be specified when a software instance name is not specified. If both a software instance UUID and name are specified, then the software instance UUID is used by default. 116 | 117 | 118 | This variable can be specified in the inventory file or as an argument on the playbook command. 119 | 120 | 121 | | **required**: False 122 | | **type**: str 123 | 124 | 125 | 126 | 127 | search_software_updates_response_file 128 | The path to the file that will contain the results from the search software updates operation. 129 | 130 | The directory must already exist otherwise there will be an error writing the results to the file. If the file exists in the directory already, it will be overwritten by the new response when the playbook is executed. If the file doesn't exist in the directory, it will be created. 131 | 132 | 133 | This variable can be specified in the inventory file or as an argument on the playbook command. 134 | 135 | 136 | | **required**: True 137 | | **type**: str 138 | 139 | 140 | 141 | 142 | updates 143 | The list of software update (SYSMOD) IDs to be searched in the subject software instance. 144 | 145 | 146 | This list variable needs to be in following format: \ :literal:`'"SYSMOD1","SYSMOD2","SYSMOD3"'`\ 147 | 148 | 149 | | **required**: True 150 | | **type**: arr 151 | 152 | 153 | 154 | 155 | remote_zmf_user 156 | User ID for authenticating with a remote z/OSMF server. Used only if the software instance resides on a remote z/OSMF server. 157 | 158 | 159 | | **required**: False 160 | | **type**: str 161 | 162 | 163 | 164 | 165 | remote_zmf_password 166 | Password for authenticating with a remote z/OSMF server. 167 | 168 | | **required**: False 169 | | **type**: str 170 | 171 | 172 | 173 | 174 | proxy_zmf_user 175 | User ID for authenticating with an HTTP proxy server. 176 | 177 | | **required**: False 178 | | **type**: str 179 | 180 | 181 | 182 | 183 | proxy_zmf_password 184 | Password for authenticating with an HTTP proxy server. 185 | 186 | | **required**: False 187 | | **type**: str 188 | 189 | 190 | 191 | 192 | Examples 193 | -------- 194 | 195 | .. code-block:: yaml+jinja 196 | 197 | 198 | - name: sample of searching a software instance for software updates 199 | hosts: sampleHost 200 | gather_facts: no 201 | collections: 202 | - ibm.ibm_zosmf 203 | 204 | tasks: 205 | - include_role : 206 | name: zmf_swmgmt_search_software_updates 207 | 208 | 209 | 210 | 211 | Notes 212 | ----- 213 | 214 | .. note:: 215 | - The given example assumes you have an inventory file \ :emphasis:`inventory.yml`\ that contains the values for the variables described above, such as z/OSMF host server, userid, password, software instance name and system, and response file name. 216 | 217 | 218 | - Command syntax to call a playbook using an inventory file: \ :literal:`ansible-playbook -i inventory software\_management\_reports\_CICDtest1.yml`\ 219 | 220 | 221 | - Command syntax to call a playbook using command arguments: \ :literal:`ansible-playbook software\_management\_reports\_CICDtest1.yml -e zmf\_user=zosmf\*\* -e zmf\_password=zosmf\*\*`\ 222 | 223 | 224 | - When the role is executed, a message shown in following example is displayed, \ :literal:`"msg": "Output filename= /tmp/xxx/search\_software\_updates\_response.json"`\ . This message includes a file path and file name where the search software updates report for the requested software instance is returned. 225 | 226 | 227 | - Refer to https://www.ibm.com/docs/en/zos/3.1.0?topic=services-software-update-search for more information on the REST API's request and response JSON. 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | -------------------------------------------------------------------------------- /docs/source/roles/zmf_swmgmt_zos_system_uuid.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/roles/zmf_swmgmt_zos_system_uuid 3 | 4 | .. _zmf_swmgmt_zos_system_uuid_module: 5 | 6 | 7 | zmf_swmgmt_zos_system_uuid -- Retrieve the z/OS system UUID 8 | =========================================================== 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - The \ :strong:`IBM z/OSMF collection`\ provides an Ansible role, referred to as \ :strong:`zmf\_swmgmt\_zos\_system\_uuid`\ , to retrieve the z/OS system UUID for the specified system nickname. The UUID identifies the software instance object that corresponds to the installed software for the specified z/OSMF host system. The UUID can be used to uniquely identify a software instance object to be acted upon by other Ansible roles. 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Variables 27 | --------- 28 | 29 | 30 | 31 | 32 | zmf_host 33 | Hostname of the z/OSMF server, specified in the inventory file or as an argument on the playbook command. 34 | 35 | 36 | | **required**: True 37 | | **type**: str 38 | 39 | 40 | 41 | 42 | zmf_port 43 | Port number of the z/OSMF server. If z/OSMF is not using the default port, you need to specify a value for this parameter in the inventory file or as an argument on the playbook command. 44 | 45 | 46 | | **required**: False 47 | | **type**: str 48 | | **default**: 443 49 | 50 | 51 | 52 | 53 | zmf_user 54 | User ID for authenticating with the z/OSMF server. 55 | 56 | This variable can be specified in the inventory file or as an argument on the playbook command. 57 | 58 | 59 | | **required**: True 60 | | **type**: str 61 | 62 | 63 | 64 | 65 | zmf_password 66 | Password to be used for authenticating with z/OSMF server. 67 | 68 | This variable can be specified in the inventory file or as an argument on the playbook command. 69 | 70 | 71 | | **required**: True 72 | | **type**: str 73 | 74 | 75 | 76 | 77 | system_nickname 78 | Nickname of the z/OSMF host system. 79 | 80 | 81 | This variable can be specified in the inventory file or as an argument on the playbook command. 82 | 83 | 84 | | **required**: True 85 | | **type**: str 86 | 87 | 88 | 89 | 90 | remote_zmf_user 91 | User ID for authenticating with a remote z/OSMF server. Used only to retrieve the UUID of a remote z/OSMF server. 92 | 93 | 94 | | **required**: False 95 | | **type**: str 96 | 97 | 98 | 99 | 100 | remote_zmf_password 101 | Password for authenticating with a remote z/OSMF server. 102 | 103 | | **required**: False 104 | | **type**: str 105 | 106 | 107 | 108 | 109 | proxy_zmf_user 110 | User ID for authenticating with an HTTP proxy server. 111 | 112 | | **required**: False 113 | | **type**: str 114 | 115 | 116 | 117 | 118 | proxy_zmf_password 119 | Password for authenticating with an HTTP proxy server. 120 | 121 | | **required**: False 122 | | **type**: str 123 | 124 | 125 | 126 | 127 | Examples 128 | -------- 129 | 130 | .. code-block:: yaml+jinja 131 | 132 | 133 | - name: sample of retrieving the z/OS system UUID 134 | hosts: sampleHost 135 | gather_facts: no 136 | collections: 137 | - ibm.ibm_zosmf 138 | 139 | tasks: 140 | - include_role : 141 | name: zmf_swmgmt_zos_system_uuid 142 | 143 | 144 | 145 | 146 | Notes 147 | ----- 148 | 149 | .. note:: 150 | - The given example assumes you have an inventory file \ :emphasis:`inventory.yml`\ that contains the values for the variables described above, such as z/OSMF host server, userid, password, system, and response file name. 151 | 152 | 153 | - Command syntax to call a playbook using an inventory file: \ :literal:`ansible-playbook -i inventory software\_management\_system\_uuid\_CICDtest1.yml`\ 154 | 155 | 156 | - Command syntax to call a playbook using command arguments: \ :literal:`ansible-playbook software\_management\_system\_uuid\_CICDtest1.yml -e zmf\_user=zosmf\*\* -e zmf\_password=zosmf\*\*`\ 157 | 158 | 159 | - When the role is executed, a message shown in following example is displayed, \ :literal:`"msg": "Output filename= /tmp/xxx/zos\_system\_uuid\_response.json"`\ . This message includes a file path and file name where the z/OS system UUID is saved. 160 | 161 | 162 | - Refer to https://www.ibm.com/docs/en/zos/3.1.0?topic=services-retrieve-zos-system-uuid for more information on the REST API's request and response JSON. 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /docs/source/roles/zmf_zmsc_run_management_service.rst: -------------------------------------------------------------------------------- 1 | 2 | :github_url: https://github.com/IBM/ibm_zosmf/tree/master/plugins/roles/zmf_zmsc_run_management_service 3 | 4 | .. _zmf_zmsc_run_management_service_module: 5 | 6 | 7 | zmf_zmsc_run_management_service -- Role runs a z/OS management service 8 | ====================================================================== 9 | 10 | 11 | .. contents:: 12 | :local: 13 | :depth: 1 14 | 15 | 16 | Synopsis 17 | -------- 18 | - The **IBM z/OSMF collection** provides an Ansible role, referred to as **zmf_zmsc_run_management_service**, to run a z/OS management service published in **z/OS Management Services Catalog**. 19 | 20 | - Management Service referenced by playbook must be published in *z/OS Management Services Catalog*. 21 | 22 | - This role will generate a unique JSON file that holds service instance information. The file location is in following format, ``/-.json`` 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Variables 31 | --------- 32 | 33 | 34 | 35 | 36 | zmf_host 37 | Hostname of the z/OSMF server, specified in the inventory file or vars file. 38 | 39 | 40 | | **required**: True 41 | | **type**: str 42 | 43 | 44 | 45 | 46 | zmf_port 47 | Port number of the z/OSMF server. If z/OSMF is not using the default port, you need to specify value for this parameter in the inventory file or vars file. 48 | 49 | 50 | | **required**: False 51 | | **type**: str 52 | | **default**: 443 53 | 54 | 55 | 56 | 57 | zmf_user 58 | User name to be used for authenticating with the z/OSMF server. 59 | 60 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 61 | 62 | 63 | | **required**: True 64 | | **type**: str 65 | 66 | 67 | 68 | 69 | zmf_password 70 | Password to be used for authenticating with z/OSMF server. 71 | 72 | This variable can be specified in the inventory file or vars file, or prompted when playbook is run. 73 | 74 | 75 | | **required**: True 76 | | **type**: str 77 | 78 | 79 | 80 | 81 | instance_record_dir 82 | Directory path that the run management service role uses to capture various information (in JSON format) about the service instance. 83 | 84 | 85 | On many system default value ``"/tmp"`` used for this variable may not be acceptable because ``"/tmp"`` directory can be transient on the system. In such cases it is recommended to specify non-default value for this variable. This variable can be specified in the inventory file or vars file. 86 | 87 | 88 | | **required**: False 89 | | **type**: str 90 | | **default**: /tmp 91 | 92 | 93 | 94 | 95 | catalog_service_name 96 | Service name of the management service to be run. 97 | 98 | | **required**: True 99 | | **type**: str 100 | 101 | 102 | 103 | 104 | category_name 105 | Category name associated with the management service to be run. If there after are multiple managment services with same name, this parameter is required to uniquely identify management service to be run. 106 | 107 | | **required**: False 108 | | **type**: str 109 | 110 | 111 | 112 | 113 | change_record_number 114 | Change record number associated with the change being performed by management service. This information is required when z/OS Management Service Catalog is configured to require change record number to run any management service. 115 | 116 | 117 | | **required**: False 118 | | **type**: str 119 | 120 | 121 | 122 | 123 | job_statement 124 | Job statement to be used when running a management service. 125 | 126 | 127 | | **required**: False 128 | | **type**: str 129 | 130 | 131 | 132 | 133 | system_nickname 134 | System nickname as specified in the z/OSMF Systems table. 135 | 136 | If this variable is not specified, management service will run on the system where z/OSMF is currently running. 137 | 138 | 139 | | **required**: False 140 | | **type**: str 141 | 142 | 143 | 144 | 145 | input_vars 146 | Input variable names and values for the management service to be run. 147 | 148 | 149 | This variable is required if management service expects specific inputs from user. This is a json variable and needs to be in following format, ``{ "var1":"value1","var2":"value2",...}`` 150 | 151 | 152 | | **required**: False 153 | | **type**: json 154 | 155 | 156 | 157 | 158 | api_polling_retry_count 159 | Total retry attempts allowed before the role exits with failure, waiting on the instance action to complete. 160 | 161 | 162 | This variable can be specified in the inventory file or vars file. 163 | 164 | 165 | | **required**: False 166 | | **type**: int 167 | | **default**: 50 168 | 169 | 170 | 171 | 172 | api_polling_interval_seconds 173 | Interval time (in seconds) for each polling request. 174 | 175 | 176 | This variable can be specified in the inventory file or vars file. 177 | 178 | 179 | | **required**: False 180 | | **type**: int 181 | | **default**: 10 182 | 183 | 184 | 185 | 186 | Examples 187 | -------- 188 | 189 | .. code-block:: yaml+jinja 190 | 191 | 192 | - name: Run z/OS Management Service 193 | hosts: sampleHost 194 | gather_facts: no 195 | collections: 196 | - ibm.ibm_zosmf 197 | tasks: 198 | - include_module: 199 | name: zmf_zmsc_run_management_service 200 | vars: 201 | catalog_service_namme: "" 202 | category_name: "" 203 | change_record_number: "" 204 | job_statement: "" 205 | systems_name: "" 206 | input_vars: "" 207 | 208 | 209 | 210 | 211 | Notes 212 | ----- 213 | 214 | .. note:: 215 | - The given example assumes that you have an inventory file *inventory.yml* and host vars *sampleHost.yml* with appropriate values to identify the target z/OSMF server end point. 216 | 217 | 218 | - When playbooks completes, a message shown in following example is displayed, ``"msg": "Instance record saved at: /tmp/xxx/xxx.json"``. This message includes a file path and file name where instance specific information is returned. 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | -------------------------------------------------------------------------------- /docs/templates/breadcrumbs.html: -------------------------------------------------------------------------------- 1 | {%- extends "sphinx_rtd_theme/breadcrumbs.html" %} 2 | 3 | {% block breadcrumbs_aside %} 4 | {% endblock %} 5 | -------------------------------------------------------------------------------- /galaxy.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2024 2 | 3 | # IBM collection namespace 4 | namespace: ibm 5 | 6 | # Ansible collection to work with z/OS based on z/OSMF 7 | name: ibm_zosmf 8 | 9 | # The collection version 10 | version: 1.5.0 11 | 12 | # Collection README file 13 | readme: README.md 14 | 15 | # Contributors 16 | authors: 17 | - "Yang Cao " 18 | - "Yun Juan Yang " 19 | - "Hiren Shah " 20 | - "Allen Zhou " 21 | - "Xiao Zhen Zhu " 22 | - "Yuan Yuan " 23 | - "Qi Li " 24 | - "Xiao Ming Liu " 25 | - "Taylor Digilio " 26 | 27 | # Description 28 | description: Ansible collection consisting of modules and roles to work with z/OS based on z/OS Management Facility(z/OSMF). 29 | 30 | # License 31 | license: 32 | - Apache-2.0 33 | 34 | # Tags 35 | tags: 36 | - ibm 37 | - z 38 | - zos 39 | - z_os 40 | - mvs 41 | - zosmf 42 | - zos_management_facility 43 | - zos_workflow 44 | - zosmf_workflow 45 | - cloud_provisioning 46 | - cics_provisioning_template 47 | - db2_provisioning_template 48 | - mq_provisioning_template 49 | - liberty_provisioning_template 50 | - zosconnect_provisioning_template 51 | - sca 52 | - security 53 | - security_configuration_assistant 54 | - zos_software_update 55 | - zos_management_services_catalog 56 | 57 | # The URL of the originating SCM repository 58 | repository: https://github.com/IBM/ibm_zosmf 59 | 60 | # The URL to any online docs 61 | documentation: https://ibm.github.io/z_ansible_collections_doc/index.html 62 | 63 | # The URL to the collection issue tracker 64 | issues: https://github.com/IBM/ibm_zosmf/issues 65 | 66 | # Ignore files and directories matching the following patterns 67 | build_ignore: 68 | - Jenkinsfile 69 | - ansible.cfg 70 | - .gitignore 71 | - .github 72 | - .git 73 | - .cache 74 | - '*.tar.gz' 75 | - docs 76 | - collections 77 | - venv 78 | - tests/CICD 79 | - tests/output 80 | - tests/sanity/ignore-2.9.txt 81 | - tests/sanity/ignore-2.10.txt 82 | - tests/sanity/ignore-2.11.txt 83 | - tests/sanity/ignore-2.12.txt 84 | - tests/sanity/ignore-2.13.txt 85 | - tests/sanity/ignore-2.14.txt 86 | - .idea 87 | - meta/context 88 | -------------------------------------------------------------------------------- /meta/execution-environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1 3 | dependencies: 4 | galaxy: requirements.yml 5 | python: requirements.txt 6 | -------------------------------------------------------------------------------- /meta/requirements.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | # This file maintains a list of any python dependencies needed by this 5 | # collection to run effectively on an Ansible controller. 6 | # For more information on requirements files, 7 | # see https://pip.pypa.io/en/latest/user_guide/#requirements-files 8 | -------------------------------------------------------------------------------- /meta/requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - ibm.ibm_zosmf 4 | -------------------------------------------------------------------------------- /meta/runtime.yml: -------------------------------------------------------------------------------- 1 | requires_ansible: ">=2.15.0" 2 | -------------------------------------------------------------------------------- /plugins/module_utils/zmf_auth_api.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | from __future__ import (absolute_import, division, print_function) 5 | __metaclass__ = type 6 | 7 | from ansible_collections.ibm.ibm_zosmf.plugins.module_utils.zmf_util import \ 8 | handle_request 9 | import re 10 | 11 | 12 | def __get_auth_apis(): 13 | """ 14 | Return the details of all z/OSMF authentication APIs. 15 | :rtype: dict[str, dict] 16 | """ 17 | return dict( 18 | # get the authentication tokens on user login for z/OSMF server 19 | getAuth=dict( 20 | method='post', 21 | header={'Content-Type': 'application/x-www-form-urlencoded'}, 22 | url='https://{zmf_host}:{zmf_port}/zosmf/services/authenticate', 23 | args={}, 24 | ok_rcode=200 25 | ) 26 | ) 27 | 28 | 29 | def __get_auth_api_argument_spec(api): 30 | """ 31 | Return the details of the specific authentication API. 32 | :param str api: the name of API 33 | :rtype: dict[str, str/int/dict] 34 | """ 35 | auth_apis = __get_auth_apis() 36 | if api in auth_apis: 37 | return auth_apis[api] 38 | 39 | 40 | def __get_auth_api_url(module, url): 41 | """ 42 | Return the parsed URL of the specific authentication API. 43 | :param AnsibleModule module: the ansible module 44 | :param str url: the initial URL of API 45 | :rtype: str 46 | """ 47 | # format the input for zmd_port 48 | if module.params['zmf_port'] is None: 49 | module.params['zmf_port'] = '' 50 | else: 51 | module.params['zmf_port'] = str(module.params['zmf_port']).strip() 52 | matchObj = re.findall('{(.+?)}', url) 53 | for x in matchObj: 54 | if x == 'zmf_port' and module.params[x] == '': 55 | url = re.sub(':{' + x + '}', module.params[x], url) 56 | else: 57 | url = re.sub('{' + x + '}', module.params[x].strip(), url) 58 | return url 59 | 60 | 61 | def call_auth_api(module, session, api): 62 | """ 63 | Return the response or error message of the specific authentication API. 64 | :param AnsibleModule module: the ansible module 65 | :param Request session: the current connection session 66 | :param str api: the name of API 67 | :rtype: dict or str 68 | """ 69 | zmf_api = __get_auth_api_argument_spec(api) 70 | zmf_api_url = __get_auth_api_url(module, zmf_api['url']) 71 | return handle_request(module, session, zmf_api['method'], zmf_api_url, 72 | zmf_api['args'], zmf_api['ok_rcode'], 73 | zmf_api['header']) 74 | -------------------------------------------------------------------------------- /plugins/modules/zmf_authenticate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (c) IBM Corporation 2021 5 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 6 | 7 | from __future__ import (absolute_import, division, print_function) 8 | __metaclass__ = type 9 | 10 | DOCUMENTATION = r""" 11 | --- 12 | module: zmf_authenticate 13 | short_description: Authenticate with z/OSMF server 14 | description: 15 | - > 16 | Authenticate with z/OSMF server by either username/password or HTTPS 17 | client authenticate. 18 | - Return the authentication credentials for successful authentication. 19 | - > 20 | The credential can be then used for succeeding Ansible tasks which call 21 | z/OSMF Ansible module or role. 22 | version_added: "1.0.0" 23 | author: 24 | - Yang Cao (@zosmf-Young) 25 | - Yun Juan Yang (@zosmf-Robyn) 26 | options: 27 | zmf_host: 28 | description: 29 | - Hostname of the z/OSMF server. 30 | required: True 31 | type: str 32 | zmf_port: 33 | description: 34 | - Port number of the z/OSMF server. 35 | required: False 36 | type: int 37 | default: null 38 | zmf_user: 39 | description: 40 | - User name to be used for authenticating with z/OSMF server. 41 | - Required when I(zmf_crt) and I(zmf_key) are not supplied. 42 | - > 43 | If I(zmf_crt) and I(zmf_key) are supplied, I(zmf_user) and 44 | I(zmf_password) are ignored. 45 | required: False 46 | type: str 47 | default: null 48 | zmf_password: 49 | description: 50 | - Password to be used for authenticating with z/OSMF server. 51 | - Required when I(zmf_crt) and I(zmf_key) are not supplied. 52 | - > 53 | If I(zmf_crt) and I(zmf_key) are supplied, I(zmf_user) and 54 | I(zmf_password) are ignored. 55 | required: False 56 | type: str 57 | default: null 58 | zmf_crt: 59 | description: 60 | - > 61 | Location of the PEM-formatted certificate chain file to be used 62 | for HTTPS client authentication. 63 | - Required when I(zmf_user) and I(zmf_password) are not supplied. 64 | required: False 65 | type: str 66 | default: null 67 | zmf_key: 68 | description: 69 | - > 70 | Location of the PEM-formatted file with your private key to be 71 | used for HTTPS client authentication. 72 | - Required when I(zmf_user) and I(zmf_password) are not supplied. 73 | required: False 74 | type: str 75 | default: null 76 | 77 | """ 78 | 79 | EXAMPLES = r""" 80 | - name: Authenticate with z/OSMF server by username/password 81 | zmf_authenticate: 82 | zmf_host: "sample.ibm.com" 83 | zmf_user: "your_username" 84 | zmf_password: "your_password" 85 | 86 | - name: Authenticate with z/OSMF server by HTTPS client authenticate 87 | zmf_authenticate: 88 | zmf_host: "sample.ibm.com" 89 | zmf_crt: "/file_with_your_certificate_chain.crt" 90 | zmf_key: "/file_with_your_private_key.key" 91 | 92 | - name: Authenticate with z/OSMF server by prompting to input username/password 93 | vars_prompt: 94 | - name: zmf_user 95 | prompt: "Enter your zOSMF username" 96 | private: false 97 | - name: zmf_password 98 | prompt: "Enter your zOSMF password" 99 | private: true 100 | tasks: 101 | - zmf_authenticate: 102 | zmf_host: "{{ zmf_host }}" 103 | zmf_port: "{{ zmf_port }}" 104 | zmf_user: "{{ zmf_user }}" 105 | zmf_password: "{{ zmf_password }}" 106 | """ 107 | 108 | RETURN = r""" 109 | changed: 110 | description: Indicates if any change is made during the module operation. 111 | returned: always 112 | type: bool 113 | ltpa_token_2: 114 | description: 115 | - > 116 | The value of Lightweight Third Party Access (LTPA) token, which 117 | supports strong encryption. 118 | returned: on success 119 | type: str 120 | sample: "yDS7uJxqrd3h8v5WXq9pf1yPtztQ4JzroZN3XQKF26ZicXgHc7mdzgycMCa......" 121 | jwt_token: 122 | description: The value of JSON Web token, which supports strong encryption. 123 | returned: on success 124 | type: str 125 | sample: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ0b2tlmVhcmVyIiwicie......" 126 | zmf_host: 127 | description: Hostname of the z/OSMF server. 128 | returned: on success 129 | type: str 130 | zmf_port: 131 | description: Port number of the z/OSMF server. 132 | returned: on success 133 | type: int 134 | """ 135 | 136 | from ansible.module_utils.basic import AnsibleModule 137 | from ansible_collections.ibm.ibm_zosmf.plugins.module_utils.zmf_util import ( 138 | get_auth_argument_spec, 139 | get_connect_session 140 | ) 141 | from ansible_collections.ibm.ibm_zosmf.plugins.module_utils.zmf_auth_api \ 142 | import call_auth_api 143 | import re 144 | 145 | 146 | def authenticate(module): 147 | """ 148 | Authenticate with z/OSMF server. 149 | Return the authentication token. 150 | :param AnsibleModule module: the ansible module 151 | """ 152 | # create session 153 | session = get_connect_session(module) 154 | # get authentication token 155 | response_getAuth = call_auth_api(module, session, 'getAuth') 156 | if isinstance(response_getAuth, dict): 157 | if ('Set-Cookie' in response_getAuth 158 | and ('LtpaToken2' in response_getAuth['Set-Cookie'] 159 | or 'jwtToken' in response_getAuth['Set-Cookie'])): 160 | auth = {} 161 | if 'LtpaToken2' in response_getAuth['Set-Cookie']: 162 | auth['ltpa_token_2'] = \ 163 | re.findall('LtpaToken2=(.+?);', 164 | response_getAuth['Set-Cookie'])[0] 165 | if 'jwtToken' in response_getAuth['Set-Cookie']: 166 | auth['jwt_token'] = \ 167 | re.findall('jwtToken=(.+?);', 168 | response_getAuth['Set-Cookie'])[0] 169 | auth['zmf_host'] = module.params['zmf_host'] 170 | auth['zmf_port'] = module.params['zmf_port'] 171 | module.exit_json(**auth) 172 | else: 173 | module.fail_json( 174 | msg='Failed to authenticate with z/OSMF server ' 175 | + '---- Cannot obtain the authentication token.') 176 | else: 177 | module.fail_json(msg='Failed to authenticate with z/OSMF server ---- ' 178 | + response_getAuth) 179 | 180 | 181 | def main(): 182 | argument_spec = get_auth_argument_spec() 183 | module = AnsibleModule( 184 | argument_spec=argument_spec, 185 | supports_check_mode=False 186 | ) 187 | authenticate(module) 188 | 189 | 190 | if __name__ == '__main__': 191 | main() 192 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | # This file maintains a list of any python dependencies needed by this 5 | # collection to run effectively on an Ansible controller. 6 | # For more information on requirements files, 7 | # see https://pip.pypa.io/en/latest/user_guide/#requirements-files 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_create_software_instance/README.md: -------------------------------------------------------------------------------- 1 | # Ansible Role: zmf_cpm_remove_software_instance 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_cpm_create_software_instance`, to create a software instance of z/OS software in CP&M software instance registry 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_cpm_create_software_instance.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2021 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_create_software_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | # defaults file for zmf_cpm_create_software_instance 5 | 6 | # The value for property zmf_port identifies the port number that z/OSMF uses. Default port number is 443. 7 | zmf_port: 443 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_create_software_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | galaxy_info: 5 | author: Hiren Shah 6 | description: Create software instance in z/OSMF CP&M registry 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - cpm 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_cpm_create_software_instance/tasks/instance_dir_util.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | 6 | - name: Get instance record directory 7 | ansible.builtin.stat: 8 | path: "{{ instance_record_dir }}/{{ inventory_hostname }}" 9 | connection: local 10 | register: target_dir 11 | 12 | - name: "Check {{ instance_record_dir }}/{{ inventory_hostname }} status" 13 | ansible.builtin.debug: 14 | msg: "{{ instance_record_dir }}/{{ inventory_hostname }} exists" 15 | when: target_dir.stat.exists 16 | 17 | - name: "Create {{ instance_record_dir }}/{{ inventory_hostname }} when not exist" 18 | ansible.builtin.file: 19 | path: "{{ instance_record_dir }}/{{ inventory_hostname }}" 20 | state: directory 21 | mode: '0755' 22 | connection: local 23 | when: not target_dir.stat.exists 24 | -------------------------------------------------------------------------------- /roles/zmf_cpm_create_software_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | # tasks file for zmf_cpm_create_software_instance 6 | 7 | - name: Instance record directory 8 | ansible.builtin.include_tasks: instance_dir_util.yml 9 | run_once: true 10 | 11 | - name: Read from json file path 12 | ansible.builtin.set_fact: 13 | instance_variable_record: "[]" 14 | when: instance_var_json_path is not defined 15 | 16 | - name: "Read from json file path" 17 | ansible.builtin.set_fact: 18 | instance_variable_record: "{{ lookup('file', instance_var_json_path) | from_json }}" 19 | when: instance_var_json_path is defined 20 | 21 | - name: Set instance_state as fact 22 | ansible.builtin.set_fact: 23 | instance_state: "provisioned" 24 | when: instance_state is not defined 25 | 26 | # Allow zmf_cs_body to be set in previous tasks. If zmf_body isn't set then set default below 27 | 28 | - name: Set zmf_cs_body as fact 29 | ansible.builtin.set_fact: 30 | zmf_cs_body: '{ 31 | "system": "{{ system_name }}","sysplex": "{{ sysplex_name }}", 32 | "registry-type": "general","external-name": "{{ external_name }}", 33 | "type": "{{ software_type }}", 34 | "vendor": "{{ vendor_name }}","version": "{{ product_version }}", 35 | "description": "{{ instance_description }}","owner": "{{ instance_owner }}", 36 | "provider": "{{ instance_provider }}","state": "{{ instance_state }}", 37 | "actions": [ {"name" : "deprovision", "type": "instructions", 38 | "instructions" : "perform this action to deprovision"} ], 39 | "variables":{{ instance_variable_record }} 40 | }' 41 | when: zmf_cs_body is not defined 42 | 43 | - name: "Create instance {{ external_name }}" 44 | ansible.builtin.uri: 45 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/scr/" 46 | return_content: true 47 | user: "{{ zmf_user | trim }}" 48 | password: "{{ zmf_password | trim }}" 49 | force_basic_auth: true 50 | headers: 51 | Host: "{{ zmf_host }}" 52 | Origin: "https://{{ zmf_host }}" 53 | method: POST 54 | status_code: "201" 55 | validate_certs: false 56 | body_format: json 57 | body: "{{ zmf_cs_body }}" 58 | delegate_to: localhost 59 | register: create_results 60 | 61 | - name: Set full_instance_json as fact 62 | ansible.builtin.set_fact: 63 | full_instance_json: "" 64 | 65 | - name: Get provisioned instance information 66 | ansible.builtin.uri: 67 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/scr/{{ create_results.json['object-id'] }}" 68 | method: GET 69 | user: "{{ zmf_user | trim }}" 70 | password: "{{ zmf_password | trim }}" 71 | force_basic_auth: true 72 | headers: 73 | Host: "{{ zmf_host }}" 74 | Origin: "https://{{ zmf_host }}" 75 | status_code: "200" 76 | validate_certs: false 77 | return_content: true 78 | register: full_instance_json 79 | delegate_to: localhost 80 | 81 | - name: Update instance information 82 | block: 83 | - name: Update fully provisioned instance information to local 84 | ansible.builtin.copy: 85 | content: '{ "registry-info" : {{ full_instance_json.json | default("") | to_nice_json(indent=2) }}}' 86 | dest: "{{ instance_record_dir }}/{{ inventory_hostname }}/{{ external_name }}-{{ create_results.json['object-name'] }}.json" 87 | mode: '0644' 88 | delegate_to: localhost 89 | 90 | - name: Set variable for instance json file path 91 | ansible.builtin.set_fact: 92 | zosmf_instance_info: "{{ full_instance_json.json }}" 93 | instance_info_json_path: "{{ instance_record_dir }}/{{ inventory_hostname }}/{{ external_name }}-\ 94 | {{ create_results.json['object-name'] }}.json" 95 | 96 | - name: Display instance record file path 97 | ansible.builtin.debug: 98 | msg: "Instance record saved at: {{ instance_record_dir }}/{{ inventory_hostname }}/{{ external_name }}-\ 99 | {{ create_results.json['object-name'] }}.json" 100 | run_once: true 101 | -------------------------------------------------------------------------------- /roles/zmf_cpm_get_software_instance/README.md: -------------------------------------------------------------------------------- 1 | # Ansible Role: zmf_cpm_remove_software_instance 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_cpm_get_software_instance`, to retrieve a software instance of z/OS software from z/OSMF Cloud Provisioning and Management registry. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_cpm_get_software_instance.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2021 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_get_software_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | # defaults file for zmf_cpm_get_software_instance 5 | 6 | # The value for property zmf_port identifies the port number that z/OSMF uses. Default port number is 443. 7 | zmf_port: 443 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_get_software_instance/docs/doc_zmf_cpm_get_software_instance: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | 4 | DOCUMENTATION = r""" 5 | role: zmf_cpm_get_software_instance 6 | short_description: Role get specific z/OS software instance 7 | description: 8 | - > 9 | The B(IBM z/OSMF collection) provides an Ansible role, referred to as 10 | B(zmf_cpm_get_software_instance), to obtain a specific software instance 11 | defined in the B(IBM Cloud Provisioning and Management (CP&M)) software 12 | instances registry. 13 | author: 14 | - Hiren Shah (@shreeji818) 15 | options: 16 | zmf_host: 17 | description: 18 | - > 19 | Hostname of the z/OSMF server, specified in the inventory file 20 | or vars file. 21 | required: True 22 | type: str 23 | zmf_port: 24 | description: 25 | - > 26 | Port number of the z/OSMF server. 27 | If z/OSMF is not using the default port, you need to specify 28 | value for this parameter in the inventory file or vars file. 29 | required: False 30 | type: str 31 | default: 443 32 | zmf_user: 33 | description: 34 | - User name to be used for authenticating with the z/OSMF server. 35 | - > 36 | This variable can be specified in the inventory file or vars 37 | file, or prompted when playbook is run. 38 | required: True 39 | type: str 40 | zmf_password: 41 | description: 42 | - Password to be used for authenticating with z/OSMF server. 43 | - > 44 | This variable can be specified in the inventory file or vars 45 | file, or prompted when playbook is run. 46 | required: True 47 | type: str 48 | instance_record_dir: 49 | description: 50 | - > 51 | Directory path that the provisioning role uses to record 52 | the software instance and associated data (in JSON format). 53 | - > 54 | On many system default value C("/tmp") used for this variable 55 | may not be acceptable because C("/tmp") directory can be 56 | transient on the system. 57 | In such cases it is recommended to specify non-default value for 58 | this variable. 59 | This variable can be specified in the inventory file or vars 60 | file. 61 | required: False 62 | type: str 63 | default: /tmp 64 | external_name: 65 | description: 66 | - > 67 | The external name associated with the previously created software 68 | instance in Cloud Provisioning and Management software registry. 69 | required: True 70 | type: str 71 | notes: 72 | - > 73 | The given example assumes that you have an inventory file 74 | I(inventory.yml) and host vars I(sampleHost.yml) with appropriate values 75 | to identify the target z/OSMF server end point. 76 | - > 77 | When playbooks completes, a message shown in following example is 78 | displayed, C("msg": "Instance record saved at: /tmp/xxx/xxx.json"). 79 | This message includes a file path and file name where the instance specific data of 80 | of requested software instance is returned. User can obtain specific property from this 81 | file using json_query. 82 | 83 | """ 84 | 85 | EXAMPLES = r""" 86 | - name: sample of retrieving software instance from registry 87 | hosts: sampleHost 88 | gather_facts: no 89 | collections: 90 | - ibm.ibm_zosmf 91 | 92 | vars: 93 | - name: instance_info_json_path 94 | 95 | tasks: 96 | - include_role: 97 | name: zmf_cpm_get_software_instance 98 | vars: 99 | external_software_name: "" 100 | 101 | - name: Obtain Variable Value 102 | vars: 103 | instance_info_json: "{{lookup('file', instance_info_json_path)}}" 104 | 105 | set_fact: 106 | 107 | VAR1: "{{ instance_info_json['registry-info'] | json_query('variables[?name == ``]') | join(' ') }}" 108 | 109 | - name: Display VAR1 value 110 | debug: 111 | msg: "VAR1 Value is : {{ VAR1.value }}" 112 | 113 | """ 114 | 115 | # Roles don't return anything. 116 | # But RETURN block must be defined for doc extraction tooling to avoid error. 117 | # The content in RETURN block will not be display in doc-site. 118 | RETURN = r""" 119 | changed: 120 | description: Indicates if any change is made during the role operation. 121 | returned: always 122 | type: bool 123 | """ -------------------------------------------------------------------------------- /roles/zmf_cpm_get_software_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | galaxy_info: 5 | author: Hiren Shah 6 | description: Get software instance from z/OSMF CP&M Registry 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - cpm 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_cpm_get_software_instance/tasks/instance_dir_util.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | 6 | - name: Get instance record directory 7 | ansible.builtin.stat: 8 | path: "{{ instance_record_dir }}/{{ inventory_hostname }}" 9 | connection: local 10 | register: target_dir 11 | 12 | - name: "Check {{ instance_record_dir }}/{{ inventory_hostname }} status" 13 | ansible.builtin.debug: 14 | msg: "{{ instance_record_dir }}/{{ inventory_hostname }} exists" 15 | when: target_dir.stat.exists 16 | 17 | - name: "Create {{ instance_record_dir }}/{{ inventory_hostname }} when not exist" 18 | ansible.builtin.file: 19 | path: "{{ instance_record_dir }}/{{ inventory_hostname }}" 20 | state: directory 21 | mode: '0755' 22 | connection: local 23 | when: not target_dir.stat.exists 24 | -------------------------------------------------------------------------------- /roles/zmf_cpm_get_software_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | # tasks file for zmf_cpm_get_software_instance 6 | 7 | - name: Instance record directory 8 | ansible.builtin.include_tasks: instance_dir_util.yml 9 | run_once: true 10 | 11 | - name: Set instance_data as fact 12 | ansible.builtin.set_fact: 13 | instance_data: "" 14 | 15 | - name: Get software instance information 16 | ansible.builtin.uri: 17 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/scr?external-name={{ external_software_name }}" 18 | method: GET 19 | user: "{{ zmf_user | trim }}" 20 | password: "{{ zmf_password | trim }}" 21 | force_basic_auth: true 22 | headers: 23 | Host: "{{ zmf_host }}" 24 | Origin: "https://{{ zmf_host }}" 25 | status_code: "200" 26 | validate_certs: false 27 | return_content: true 28 | register: instance_data 29 | delegate_to: localhost 30 | 31 | - name: Set instance_object_id as fact 32 | ansible.builtin.set_fact: 33 | instance_object_id: "{{ instance_data.json['scr-list'][0]['object-id'] }}" 34 | 35 | 36 | - name: Set full_instance_json as fact 37 | ansible.builtin.set_fact: 38 | full_instance_json: "" 39 | 40 | - name: Get full software instance information 41 | ansible.builtin.uri: 42 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/scr/{{ instance_object_id }}" 43 | method: GET 44 | user: "{{ zmf_user | trim }}" 45 | password: "{{ zmf_password | trim }}" 46 | force_basic_auth: true 47 | headers: 48 | Host: "{{ zmf_host }}" 49 | Origin: "https://{{ zmf_host }}" 50 | status_code: "200" 51 | validate_certs: false 52 | return_content: true 53 | register: full_instance_json 54 | delegate_to: localhost 55 | 56 | - name: Update instance information 57 | block: 58 | - name: Update fully provisioned instance information to local 59 | ansible.builtin.copy: 60 | content: '{ "registry-info" : {{ full_instance_json.json | default("") | to_nice_json(indent=2) }}}' 61 | dest: "{{ instance_record_dir }}/{{ inventory_hostname }}/{{ external_software_name }}-\ 62 | {{ full_instance_json.json['object-name'] }}.json" 63 | mode: '0644' 64 | delegate_to: localhost 65 | 66 | - name: Set variable for instance json file path 67 | ansible.builtin.set_fact: 68 | zosmf_instance_info: "{{ full_instance_json.json }}" 69 | instance_info_json_path: "{{ instance_record_dir }}/{{ inventory_hostname }}/{{ external_software_name }}-\ 70 | {{ full_instance_json.json['object-name'] }}.json" 71 | 72 | - name: Display instance record file path 73 | ansible.builtin.debug: 74 | msg: "Instance record saved at: {{ instance_record_dir }}/{{ inventory_hostname }}/{{ external_software_name }}-\ 75 | {{ full_instance_json.json['object-name'] }}.json" 76 | run_once: true 77 | -------------------------------------------------------------------------------- /roles/zmf_cpm_list_software_templates/README.md: -------------------------------------------------------------------------------- 1 | # Ansible Role: zmf_cpm_remove_software_instance 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_cpm_list_software_templates`, to remove a deprovisioned instance of z/OS middleware/software. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_cpm_list_software_templates.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2021 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_list_software_templates/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | # defaults file for zmf_cpm_list_software_templates 5 | 6 | # The value for property zmf_port identifies the port number that z/OSMF uses. Default port number is 443. 7 | zmf_port: 443 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_list_software_templates/docs/doc_zmf_cpm_list_software_templates: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | 4 | DOCUMENTATION = r""" 5 | role: zmf_cpm_list_software_templates 6 | short_description: Role lists all published z/OS software templates 7 | description: 8 | - > 9 | The B(IBM z/OSMF collection) provides an Ansible role, referred to as 10 | B(zmf_cpm_list_software_templates), to obtain list of all the published 11 | templates that can be used to provision z/OS middleware such as 12 | IBM Customer Information Control System (CICS®), IBM Db2®, IBM MQ, and 13 | IBM WebSphere Application Server or any other software service from 14 | B(IBM Cloud Provisioning and Management (CP&M)) catalog. 15 | author: 16 | - Hiren Shah (@shreeji818) 17 | options: 18 | zmf_host: 19 | description: 20 | - > 21 | Hostname of the z/OSMF server, specified in the inventory file 22 | or vars file. 23 | required: True 24 | type: str 25 | zmf_port: 26 | description: 27 | - > 28 | Port number of the z/OSMF server. 29 | If z/OSMF is not using the default port, you need to specify 30 | value for this parameter in the inventory file or vars file. 31 | required: False 32 | type: str 33 | default: 443 34 | zmf_user: 35 | description: 36 | - User name to be used for authenticating with the z/OSMF server. 37 | - > 38 | This variable can be specified in the inventory file or vars 39 | file, or prompted when playbook is run. 40 | required: True 41 | type: str 42 | zmf_password: 43 | description: 44 | - Password to be used for authenticating with z/OSMF server. 45 | - > 46 | This variable can be specified in the inventory file or vars 47 | file, or prompted when playbook is run. 48 | required: True 49 | type: str 50 | instance_record_dir: 51 | description: 52 | - > 53 | Directory path that the provisioning role uses to capture 54 | list of published templates (in JSON format). 55 | - > 56 | On many system default value C("/tmp") used for this variable 57 | may not be acceptable because C("/tmp") directory can be 58 | transient on the system. 59 | In such cases it is recommended to specify non-default value for 60 | this variable. 61 | This variable can be specified in the inventory file or vars 62 | file. 63 | required: False 64 | type: str 65 | default: /tmp 66 | notes: 67 | - > 68 | The given example assumes that you have an inventory file 69 | I(inventory.yml) and host vars I(sampleHost.yml) with appropriate values 70 | to identify the target z/OSMF server end point. 71 | - > 72 | When playbooks completes, a message shown in following example is 73 | displayed, C("msg": "Published Template List saved at: /tmp/xxx.json"). 74 | This message includes a file path and file name where the list of published template 75 | is returned. 76 | 77 | """ 78 | 79 | EXAMPLES = r""" 80 | - name: list published provisioning templates 81 | hosts: sampleHost 82 | gather_facts: no 83 | collections: 84 | - ibm.ibm_zosmf 85 | tasks: 86 | - include_role: 87 | name: zmf_cpm_list_software_templates 88 | 89 | """ 90 | 91 | # Roles don't return anything. 92 | # But RETURN block must be defined for doc extraction tooling to avoid error. 93 | # The content in RETURN block will not be display in doc-site. 94 | RETURN = r""" 95 | changed: 96 | description: Indicates if any change is made during the role operation. 97 | returned: always 98 | type: bool 99 | """ -------------------------------------------------------------------------------- /roles/zmf_cpm_list_software_templates/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | galaxy_info: 5 | author: Hiren Shah 6 | description: Obtain list of published template from z/OSMF CP&M catalog 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - cpm 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_cpm_list_software_templates/tasks/instance_dir_util.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | 6 | - name: Get instance record directory 7 | ansible.builtin.stat: 8 | path: "{{ instance_record_dir }}/{{ inventory_hostname }}" 9 | connection: local 10 | register: target_dir 11 | 12 | - name: "Check {{ instance_record_dir }}/{{ inventory_hostname }} status" 13 | ansible.builtin.debug: 14 | msg: "{{ instance_record_dir }}/{{ inventory_hostname }} exists" 15 | when: target_dir.stat.exists 16 | 17 | - name: "Create {{ instance_record_dir }}/{{ inventory_hostname }} when not exist" 18 | ansible.builtin.file: 19 | path: "{{ instance_record_dir }}/{{ inventory_hostname }}" 20 | state: directory 21 | mode: '0755' 22 | connection: local 23 | when: not target_dir.stat.exists 24 | -------------------------------------------------------------------------------- /roles/zmf_cpm_list_software_templates/tasks/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | # tasks file for zmf_cpm_list_software_templates 6 | 7 | - name: Instance record directory 8 | ansible.builtin.include_tasks: instance_dir_util.yml 9 | run_once: true 10 | 11 | - name: "List published provisioning templates" 12 | ansible.builtin.uri: 13 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/psc/" 14 | user: "{{ zmf_user | trim }}" 15 | password: "{{ zmf_password | trim }}" 16 | force_basic_auth: true 17 | headers: 18 | Host: "{{ zmf_host }}" 19 | Origin: "https://{{ zmf_host }}" 20 | method: GET 21 | status_code: "200" 22 | validate_certs: false 23 | return_content: true 24 | delegate_to: localhost 25 | register: list_results 26 | 27 | - name: Update instance information 28 | block: 29 | - name: Update fully provisioned instance information to local 30 | ansible.builtin.copy: 31 | content: '{{ list_results.json | default("") | to_nice_json(indent=2) }}' 32 | dest: "{{ instance_record_dir }}/{{ inventory_hostname }}/Published_Templates_List.json" 33 | mode: '0644' 34 | delegate_to: localhost 35 | 36 | - name: Set variable for template info json file path 37 | ansible.builtin.set_fact: 38 | template_info_json_path: "{{ instance_record_dir }}/{{ inventory_hostname }}/\ 39 | Published_Templates_List.json" 40 | 41 | - name: Display template record file path 42 | ansible.builtin.debug: 43 | msg: "Published template list saved at: 44 | {{ instance_record_dir }}/{{ inventory_hostname }}/Published_Templates_List.json" 45 | run_once: true 46 | -------------------------------------------------------------------------------- /roles/zmf_cpm_manage_software_instance/README.md: -------------------------------------------------------------------------------- 1 | # Ansible Role: zmf_cpm_manage_software_instance 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_cpm_manage_software_instance`, to manage a provisioned instance of z/OS middleware/software. Various management such as starting or stopping the instance can be performed using this role. When software service instance is not required any more, it can be deprovisioned using this role. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_cpm_manage_software_instance.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2021 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_manage_software_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | # defaults file for zmf_cpm_manage_software_instance 5 | 6 | # The value for property api_polling_retry_count identifies max times of status polling before task fail and exit 7 | api_polling_retry_count: 50 8 | # The value for property api_polling_interval_seconds identifies interval in seconds between each 9 | # api_polling_retry_count polling 10 | api_polling_interval_seconds: 10 11 | # The value for the zmf_port property identifies the port number that z/OSMF uses. Default port number is 443. 12 | zmf_port: 443 13 | -------------------------------------------------------------------------------- /roles/zmf_cpm_manage_software_instance/docs/doc_zmf_cpm_manage_software_instance: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | 4 | DOCUMENTATION = r""" 5 | role: zmf_cpm_manage_software_instance 6 | short_description: Role manages a provisioned z/OS software instance 7 | description: 8 | - > 9 | The B(IBM z/OSMF collection) provides an Ansible role, referred to as 10 | B(zmf_cpm_manage_software_instance), to manage a provisioned instance of 11 | z/OS middleware such as IBM Customer Information Control System (CICS®), 12 | IBM Db2®, IBM Information Management System (IMS™), IBM MQ, and IBM 13 | WebSphere Application Server or any other software service. 14 | - > 15 | Depending on actions supported by z/OS middleware or software, various 16 | management such as starting or stopping the instance can be performed 17 | by using this role. 18 | - > 19 | When software service instance is not required any more, it can be 20 | deprovisioned by using this role. 21 | author: 22 | - Hiren Shah (@shreeji818) 23 | options: 24 | zmf_host: 25 | description: 26 | - > 27 | Hostname of the z/OSMF server, specified in the inventory file 28 | or vars file. 29 | required: True 30 | type: str 31 | zmf_port: 32 | description: 33 | - > 34 | Port number of the z/OSMF server. 35 | If z/OSMF is not using the default port, you need to specify 36 | value for this parameter in the inventory file or vars file. 37 | required: False 38 | type: str 39 | default: 443 40 | zmf_user: 41 | description: 42 | - User name to be used for authenticating with the z/OSMF server. 43 | - > 44 | This variable can be specified in the inventory file or vars 45 | file, or prompted when playbook is run. 46 | required: True 47 | type: str 48 | zmf_password: 49 | description: 50 | - Password to be used for authenticating with z/OSMF server. 51 | - > 52 | This variable can be specified in the inventory file or vars 53 | file, or prompted when playbook is run. 54 | required: True 55 | type: str 56 | instance_action_name: 57 | description: 58 | - > 59 | Action to be performed on a provisioned software instance, for 60 | example, C(Deprovision). 61 | - > 62 | Actions that can be performed on a provisioned instance are 63 | described in local record file that is associated with the 64 | provisioned instance. 65 | The I(name) variable in I(actions) array under I(registry-info) 66 | identifies the various actions that can be performed on the 67 | instance. 68 | required: True 69 | type: str 70 | instance_info_json_path: 71 | description: 72 | - > 73 | Directory path for the JSON file that holds provisioned instance 74 | information. 75 | - > 76 | Specify the file name that was generated when the 77 | M(zmf_cpm_provision_software_service) role was performed. 78 | required: True 79 | type: str 80 | input_vars: 81 | description: 82 | - > 83 | Input variable names and values for the action to be performed 84 | on the provisioned instance. 85 | - > 86 | This variable is required if the action processing expects 87 | specific inputs from user. 88 | This is a dictionary variable and needs to be in following 89 | format, C([{ "name":"VAR1","value":"VAR1_VALUE"},{..},...]) 90 | required: False 91 | type: dict 92 | default: null 93 | api_polling_retry_count: 94 | description: 95 | - > 96 | Total retry attempts allowed before the role exits with failure, 97 | waiting on the instance action to complete. 98 | - > 99 | This variable can be specified in the inventory file or vars 100 | file. 101 | required: False 102 | type: int 103 | default: 50 104 | api_polling_interval_seconds: 105 | description: 106 | - > 107 | Interval time (in seconds) for each polling request. 108 | - > 109 | This variable can be specified in the inventory file or vars 110 | file. 111 | required: False 112 | type: int 113 | default: 10 114 | notes: 115 | - > 116 | The given example assumes that you have an inventory file 117 | I(inventory.yml) and host vars I(sampleHost.yml) with appropriate values 118 | to identify the target z/OSMF server end point. 119 | """ 120 | 121 | EXAMPLES = r""" 122 | - name: Perform action on provisioned instance of z/OS Middleware 123 | hosts: sampleHost 124 | gather_facts: no 125 | collections: 126 | - ibm.ibm_zosmf 127 | tasks: 128 | - include_role: 129 | name: zmf_cpm_manage_software_instance 130 | vars: 131 | instance_action_name: "" 132 | instance_info_json_path: "" 133 | input_vars: '' 134 | """ 135 | 136 | # Roles don't return anything. 137 | # But RETURN block must be defined for doc extraction tooling to avoid error. 138 | # The content in RETURN block will not be display in doc-site. 139 | RETURN = r""" 140 | changed: 141 | description: Indicates if any change is made during the role operation. 142 | returned: always 143 | type: bool 144 | """ -------------------------------------------------------------------------------- /roles/zmf_cpm_manage_software_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | galaxy_info: 5 | author: Hiren Shah , Allen Zhou 6 | description: Perform management action on z/OSMF CP&M instance 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - cpm 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_cpm_manage_software_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | # tasks file for zmf_cpm_manage_software_instance 6 | 7 | - name: "Read instance record" 8 | block: 9 | - name: "Read from json file path" 10 | ansible.builtin.set_fact: 11 | instance_record: "{{ lookup('file', instance_info_json_path) | from_json }}" 12 | 13 | # Support input_vars to be provided via playbook. If input_vars isn't set then set default below 14 | - name: "Set input_vars as fact" 15 | ansible.builtin.set_fact: 16 | input_vars: "[]" 17 | when: input_vars is not defined 18 | 19 | - name: "Perform action <{{ instance_action_name }}> on {{ instance_record['registry-info']['object-id'] }}" 20 | ansible.builtin.uri: 21 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/scr/\ 22 | {{ instance_record['registry-info']['object-id'] }}/actions/{{ instance_action_name }}" 23 | return_content: true 24 | user: "{{ zmf_user | trim }}" 25 | password: "{{ zmf_password | trim }}" 26 | force_basic_auth: true 27 | headers: 28 | Host: "{{ zmf_host }}" 29 | Origin: "https://{{ zmf_host }}" 30 | method: POST 31 | status_code: "200" 32 | validate_certs: false 33 | body_format: json 34 | body: '{"input-variables":{{ input_vars }}}' 35 | delegate_to: localhost 36 | register: action_results 37 | 38 | - name: "Get action <{{ instance_action_name }}> progress status" 39 | ansible.builtin.uri: 40 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf\ 41 | /provisioning/rest/1.0/scr\ 42 | /{{ instance_record['registry-info']['object-id'] }}\ 43 | /actions/{{ action_results.json['action-id'] }}" 44 | return_content: true 45 | user: "{{ zmf_user | trim }}" 46 | password: "{{ zmf_password | trim }}" 47 | force_basic_auth: true 48 | headers: 49 | Host: "{{ zmf_host }}" 50 | Origin: "https://{{ zmf_host }}" 51 | method: GET 52 | status_code: "200" 53 | validate_certs: false 54 | delegate_to: localhost 55 | register: action_status_result 56 | until: ('json' in action_status_result) and (action_status_result.json.state == "complete" or action_status_result.json.state == "failed") 57 | retries: "{{ api_polling_retry_count }}" 58 | delay: "{{ api_polling_interval_seconds }}" 59 | 60 | - name: "Display action failure information" 61 | ansible.builtin.fail: 62 | msg: "Action <{{ instance_action_name }}> progress status: {{ action_status_result.json.state }} " 63 | when: action_status_result.json.state == "failed" 64 | 65 | - name: "Get updated instance information for {{ instance_record['registry-info']['object-id'] }}" 66 | ansible.builtin.uri: 67 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/scr/{{ instance_record['registry-info']['object-id'] }}" 68 | method: GET 69 | user: "{{ zmf_user | trim }}" 70 | password: "{{ zmf_password | trim }}" 71 | force_basic_auth: true 72 | headers: 73 | Host: "{{ zmf_host }}" 74 | Origin: "https://{{ zmf_host }}" 75 | status_code: "200" 76 | validate_certs: false 77 | return_content: true 78 | register: full_instance_json 79 | when: action_status_result.json.state == "complete" 80 | delegate_to: localhost 81 | 82 | - name: "Update local copy of instance information" 83 | block: 84 | - name: Update fully provisioned instance information to local 85 | ansible.builtin.copy: 86 | content: '{ "registry-info" : {{ full_instance_json.json | default("") | to_nice_json(indent=2) }}}' 87 | dest: '{{ instance_info_json_path }}' 88 | mode: '0644' 89 | delegate_to: localhost 90 | 91 | - name: "Display instance record file path" 92 | ansible.builtin.debug: 93 | msg: "Instance record updated at: {{ instance_info_json_path }}" 94 | 95 | - name: "Display action performed and complete status" 96 | ansible.builtin.debug: 97 | msg: "Action <{{ instance_action_name }}> final status: {{ action_status_result.json.state }}" 98 | when: action_status_result.json.state == "complete" 99 | -------------------------------------------------------------------------------- /roles/zmf_cpm_provision_software_service/README.md: -------------------------------------------------------------------------------- 1 | # Ansible Role: zmf_cpm_provision_software_service 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_cpm_provision_software_service`, to provision a z/OS middleware/software service using Cloud Provisioning & Management (CP&M) template. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_cpm_provision_software_service.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2021 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_provision_software_service/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | # defaults file for zmf_cpm_provision_software_service 5 | 6 | # The value for property instance_record_dir identifies the file path in local system where the provision 7 | # result (in json) will be stored 8 | instance_record_dir: "/tmp" 9 | # The value for property api_polling_retry_count identifies max times of status polling before task fail and exit 10 | api_polling_retry_count: 50 11 | # The value for property api_polling_interval_seconds identifies interval in seconds between each 12 | # api_polling_retry_count polling 13 | api_polling_interval_seconds: 10 14 | # The value for property zmf_port identifies the port number that z/OSMF uses. Default port number is 443. 15 | zmf_port: 443 16 | -------------------------------------------------------------------------------- /roles/zmf_cpm_provision_software_service/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | galaxy_info: 5 | author: Hiren Shah , Allen Zhou 6 | description: Perform provision of z/OSMF CP&M instance 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - cpm 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_cpm_provision_software_service/tasks/instance_dir_util.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | 6 | - name: Get instance record directory 7 | ansible.builtin.stat: 8 | path: "{{ instance_record_dir }}/{{ inventory_hostname }}" 9 | connection: local 10 | register: target_dir 11 | 12 | - name: "Check {{ instance_record_dir }}/{{ inventory_hostname }} status" 13 | ansible.builtin.debug: 14 | msg: "{{ instance_record_dir }}/{{ inventory_hostname }} exists" 15 | when: target_dir.stat.exists 16 | 17 | - name: "Create {{ instance_record_dir }}/{{ inventory_hostname }} when not exist" 18 | ansible.builtin.file: 19 | path: "{{ instance_record_dir }}/{{ inventory_hostname }}" 20 | state: directory 21 | mode: '0755' 22 | connection: local 23 | when: not target_dir.stat.exists 24 | -------------------------------------------------------------------------------- /roles/zmf_cpm_provision_software_service/tasks/loop_instance_provision_step_state.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | - name: Examining workflow progress status 6 | block: 7 | - name: Pause 8 | ansible.builtin.pause: 9 | prompt: "Waiting {{ api_polling_interval_seconds }} seconds before next polling workflow progress status" 10 | seconds: "{{ api_polling_interval_seconds }}" 11 | 12 | - name: Retrieve provision step information 13 | ansible.builtin.uri: 14 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/scr/{{ instance_object_id }}" 15 | return_content: true 16 | user: "{{ zmf_user | trim }}" 17 | password: "{{ zmf_password | trim }}" 18 | force_basic_auth: true 19 | headers: 20 | Host: "{{ zmf_host }}" 21 | Origin: "https://{{ zmf_host }}" 22 | method: GET 23 | status_code: "200" 24 | validate_certs: false 25 | delegate_to: localhost 26 | register: results 27 | no_log: true 28 | 29 | - name: "Gather provision step information" 30 | ansible.builtin.set_fact: 31 | current_step_name: "{{ results.json['workflow-current-step-name'] }}" 32 | current_step_number: "{{ results.json['workflow-current-step-number'] }}" 33 | total_step_number: "{{ results.json['workflow-total-steps'] }}" 34 | 35 | - name: "Check if provision failed" 36 | ansible.builtin.fail: 37 | msg: 38 | - Provision Failed at - step <{{ current_step_name }}> ({{ current_step_number }} / {{ total_step_number }}) 39 | - Reason - {{ results.json['workflow-message-text'] }} 40 | when: results.json.state == "provisioning-failed" 41 | 42 | - name: Verify overall workflow progress status 43 | block: 44 | 45 | - name: Set the retry count for verification progress 46 | ansible.builtin.set_fact: 47 | retry_count: "{{ 1 if retry_count is undefined else retry_count | int + 1 }}" 48 | max_retry: "{{ api_polling_retry_count }}" 49 | 50 | - name: Display current polling count 51 | ansible.builtin.debug: 52 | msg: "Polling {{ retry_count }} of {{ api_polling_retry_count }} tries..." 53 | 54 | - name: "Gather provision API response" 55 | ansible.builtin.set_fact: 56 | provision_current_state: "{{ 'being-provisioned' if results.json.state is undefined else results.json.state | string }}" 57 | provision_current_step_name: >- 58 | {{ 'Not available' if results.json['workflow-current-step-name'] is undefined 59 | else results.json['workflow-current-step-name'] | string }} 60 | provision_current_step: >- 61 | {{ provision_current_step if results.json['workflow-current-step-number'] is undefined 62 | else results.json['workflow-current-step-number'] }} 63 | provision_total_step: "{{ 1 if results.json['workflow-total-steps'] | int == 0 else results.json['workflow-total-steps'] | int }}" 64 | 65 | - name: Display current polling count 66 | ansible.builtin.debug: 67 | msg: 68 | - "Current status: {{ provision_current_state }}" 69 | - "Step name: {{ provision_current_step_name }}" 70 | - "Progress: ({{ provision_current_step }} / {{ provision_total_step }})" 71 | when: 72 | - provision_current_state != 'provisioned' 73 | 74 | - name: "Check over all provision process (ignore the failure of this task), skip if complete" 75 | ansible.builtin.debug: 76 | msg: "Ignore and retry" 77 | when: 78 | - provision_current_state != 'provisioned' 79 | 80 | always: 81 | - name: "Failure exit on polling provision information" 82 | ansible.builtin.fail: 83 | msg: "Reached max retry limit {{ api_polling_retry_count }} while workflow still not at 100% complete, aborting..." 84 | when: retry_count|int == max_retry 85 | 86 | - name: Include tasks 87 | ansible.builtin.include_tasks: loop_instance_provision_step_state.yml 88 | when: 89 | - provision_current_state != 'provisioned' 90 | -------------------------------------------------------------------------------- /roles/zmf_cpm_provision_software_service/tasks/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | # tasks file for zmf_cpm_provision_software_service 6 | 7 | - name: Instance record directory 8 | ansible.builtin.include_tasks: instance_dir_util.yml 9 | run_once: true 10 | 11 | # Support input_vars to be provided via playbook. If input_vars isn't set then set default below 12 | - name: Set input_vars as fact 13 | ansible.builtin.set_fact: 14 | input_vars: "[]" 15 | when: input_vars is not defined 16 | 17 | - name: Set tenant_name as fact 18 | ansible.builtin.set_fact: 19 | tenant_name: "default" 20 | when: tenant_name is not defined 21 | 22 | - name: Set systems_nicknames as fact 23 | ansible.builtin.set_fact: 24 | sysnames: '["{{ systems_nicknames }}"]' 25 | when: systems_nicknames is defined 26 | 27 | - name: Set systems_nicknames as fact 28 | ansible.builtin.set_fact: 29 | sysnames: "[]" 30 | when: systems_nicknames is not defined 31 | 32 | # Allow zmf_body to be set in previous tasks. If zmf_body isn't set then set default below 33 | - name: Set zmf_body as fact 34 | ansible.builtin.set_fact: 35 | zmf_body: '{"domain-name":"{{ domain_name }}","tenant-name":"{{ tenant_name }}", 36 | "systems-nicknames": {{ sysnames }},"input-variables":{{ input_vars }}}' 37 | when: zmf_body is not defined 38 | 39 | - name: Provision template 40 | ansible.builtin.uri: 41 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/psc/{{ cpm_template_name }}/actions/run" 42 | return_content: true 43 | user: "{{ zmf_user | trim }}" 44 | password: "{{ zmf_password | trim }}" 45 | force_basic_auth: true 46 | headers: 47 | Host: "{{ zmf_host }}" 48 | Origin: "https://{{ zmf_host }}" 49 | method: POST 50 | status_code: "200" 51 | validate_certs: false 52 | body_format: json 53 | body: "{{ zmf_body }}" 54 | delegate_to: localhost 55 | register: provision_results 56 | 57 | - name: Write instance information to disk 58 | ansible.builtin.copy: 59 | content: "{{ provision_results.json | to_nice_json(indent=2) }}" 60 | dest: "{{ instance_record_dir }}/{{ inventory_hostname }}/{{ cpm_template_name }}-{{ provision_results.json['registry-info']['external-name'] }}.json" 61 | mode: '0644' 62 | delegate_to: localhost 63 | 64 | - name: Display instance record file path 65 | ansible.builtin.debug: 66 | msg: "Instance record saved at: {{ instance_record_dir }}/{{ inventory_hostname }}/{{ cpm_template_name }}-\ 67 | {{ provision_results.json['registry-info']['external-name'] }}.json" 68 | 69 | ############################################################################## 70 | # Verify workflow step status, requires the following variables: 71 | # {{zmf_host:zmf_port}} -> z/OSMF host uri 72 | # {{max_retry}} -> max retry count before task exit with failing status 73 | ############################################################################## 74 | - name: Provision instance section 75 | ansible.builtin.include_tasks: loop_instance_provision_step_state.yml 76 | vars: 77 | instance_object_id: "{{ provision_results.json['registry-info']['object-id'] }}" 78 | 79 | - name: Set full_instance_json as fact 80 | ansible.builtin.set_fact: 81 | full_instance_json: "" 82 | 83 | - name: Get provisioned instance information 84 | ansible.builtin.uri: 85 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/scr/{{ provision_results.json['registry-info']['object-id'] }}" 86 | method: GET 87 | user: "{{ zmf_user | trim }}" 88 | password: "{{ zmf_password | trim }}" 89 | force_basic_auth: true 90 | headers: 91 | Host: "{{ zmf_host }}" 92 | Origin: "https://{{ zmf_host }}" 93 | status_code: "200" 94 | validate_certs: false 95 | return_content: true 96 | register: full_instance_json 97 | delegate_to: localhost 98 | 99 | - name: Update instance information 100 | block: 101 | - name: Update fully provisioned instance information to local 102 | ansible.builtin.copy: 103 | content: '{ "registry-info" : {{ full_instance_json.json | default("") | to_nice_json(indent=2) }}}' 104 | dest: "{{ instance_record_dir }}/{{ inventory_hostname }}/{{ cpm_template_name }}-{{ provision_results.json['registry-info']['external-name'] }}.json" 105 | mode: '0644' 106 | delegate_to: localhost 107 | 108 | - name: Set variable for instance json file path 109 | ansible.builtin.set_fact: 110 | zosmf_instance_info: "{{ full_instance_json.json }}" 111 | instance_info_json_path: "{{ instance_record_dir }}/{{ inventory_hostname }}/{{ cpm_template_name }}-\ 112 | {{ provision_results.json['registry-info']['external-name'] }}.json" 113 | 114 | - name: Display instance record file path 115 | ansible.builtin.debug: 116 | msg: "Instance record saved at: {{ instance_record_dir }}/{{ inventory_hostname }}/{{ cpm_template_name }}-\ 117 | {{ provision_results.json['registry-info']['external-name'] }}.json" 118 | run_once: true 119 | -------------------------------------------------------------------------------- /roles/zmf_cpm_remove_software_instance/README.md: -------------------------------------------------------------------------------- 1 | # Ansible Role: zmf_cpm_remove_software_instance 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_cpm_remove_software_instance`, to remove a deprovisioned instance of z/OS middleware/software. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_cpm_remove_software_instance.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2021 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_remove_software_instance/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | # defaults file for zmf_cpm_remove_software_instance 5 | 6 | # The value for property zmf_port identifies the port number that z/OSMF uses. Default port number is 443. 7 | zmf_port: 443 8 | -------------------------------------------------------------------------------- /roles/zmf_cpm_remove_software_instance/docs/doc_zmf_cpm_remove_software_instance: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | 4 | DOCUMENTATION = r""" 5 | role: zmf_cpm_remove_software_instance 6 | short_description: Role removes a z/OS software instance 7 | description: 8 | - > 9 | The B(IBM z/OSMF collection) provides an Ansible role, referred to as 10 | B(zmf_cpm_remove_software_instance), to remove a deprovisioned instance 11 | of z/OS middleware such as IBM Customer Information Control System 12 | (CICS®), IBM Db2®, IBM Information Management System (IMS™), IBM MQ, and 13 | IBM WebSphere Application Server or any other software service from 14 | B(IBM Cloud Provisioning and Management (CP&M)) registry. 15 | author: 16 | - Hiren Shah (@shreeji818) 17 | options: 18 | zmf_host: 19 | description: 20 | - > 21 | Hostname of the z/OSMF server, specified in the inventory file 22 | or vars file. 23 | required: True 24 | type: str 25 | zmf_port: 26 | description: 27 | - > 28 | Port number of the z/OSMF server. 29 | If z/OSMF is not using the default port, you need to specify 30 | value for this parameter in the inventory file or vars file. 31 | required: False 32 | type: str 33 | default: 443 34 | zmf_user: 35 | description: 36 | - User name to be used for authenticating with the z/OSMF server. 37 | - > 38 | This variable can be specified in the inventory file or vars 39 | file, or prompted when playbook is run. 40 | required: True 41 | type: str 42 | zmf_password: 43 | description: 44 | - Password to be used for authenticating with z/OSMF server. 45 | - > 46 | This variable can be specified in the inventory file or vars 47 | file, or prompted when playbook is run. 48 | required: True 49 | type: str 50 | instance_info_json_path: 51 | description: 52 | - > 53 | Directory path for the JSON file that holds provisioned instance 54 | information. 55 | - > 56 | Specify the file name that was generated when the 57 | M(zmf_cpm_provision_software_service) role was performed. 58 | required: True 59 | type: str 60 | notes: 61 | - > 62 | The given example assumes that you have an inventory file 63 | I(inventory.yml) and host vars I(sampleHost.yml) with appropriate values 64 | to identify the target z/OSMF server end point. 65 | """ 66 | 67 | EXAMPLES = r""" 68 | - name: Remove deprovisioned instance of z/OS Middleware 69 | hosts: sampleHost 70 | gather_facts: no 71 | collections: 72 | - ibm.ibm_zosmf 73 | tasks: 74 | - include_role: 75 | name: zmf_cpm_remove_software_instance 76 | vars: 77 | instance_info_json_path: "" 78 | """ 79 | 80 | # Roles don't return anything. 81 | # But RETURN block must be defined for doc extraction tooling to avoid error. 82 | # The content in RETURN block will not be display in doc-site. 83 | RETURN = r""" 84 | changed: 85 | description: Indicates if any change is made during the role operation. 86 | returned: always 87 | type: bool 88 | """ -------------------------------------------------------------------------------- /roles/zmf_cpm_remove_software_instance/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | galaxy_info: 5 | author: Hiren Shah , Allen Zhou 6 | description: Perform management action on z/OSMF CP&M instance 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - cpm 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_cpm_remove_software_instance/tasks/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | # tasks file for zmf_cpm_remove_software_instance 6 | 7 | - name: Read from json file path 8 | ansible.builtin.set_fact: 9 | instance_record: "{{ lookup('file', instance_info_json_path) | from_json }}" 10 | 11 | - name: "Remove instance {{ instance_record['registry-info']['object-id'] }}" 12 | ansible.builtin.uri: 13 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/provisioning/rest/1.0/scr/{{ instance_record['registry-info']['object-id'] }}" 14 | return_content: true 15 | user: "{{ zmf_user | trim }}" 16 | password: "{{ zmf_password | trim }}" 17 | force_basic_auth: true 18 | headers: 19 | Host: "{{ zmf_host }}" 20 | Origin: "https://{{ zmf_host }}" 21 | method: DELETE 22 | status_code: 204, 404 23 | validate_certs: false 24 | body_format: json 25 | body: "{}" 26 | delegate_to: localhost 27 | 28 | - name: Clean instance record file 29 | ansible.builtin.file: 30 | state: absent 31 | path: "{{ instance_info_json_path }}" 32 | delegate_to: localhost 33 | -------------------------------------------------------------------------------- /roles/zmf_swmgmt_csi_query/README.md: -------------------------------------------------------------------------------- 1 | # Ansible role: zmf_swmgmt_csi_query 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_swmgmt_csi_query`, to run the csi query REST API. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_swmgmt_csi_query.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2024 -------------------------------------------------------------------------------- /roles/zmf_swmgmt_csi_query/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2024 2 | 3 | --- 4 | # defaults file for zmf_swmgmt_csi_query 5 | async_thread_check_times: 60 6 | async_thread_check_delay: 1 7 | -------------------------------------------------------------------------------- /roles/zmf_swmgmt_csi_query/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2024 2 | 3 | --- 4 | galaxy_info: 5 | author: Taylor Digilio 6 | description: Ansible role to complete the Software Management CSI Query REST API for a software instance, UUID, or global zone csi data set. 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - softwaremanagement 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_swmgmt_identify_missing_critical_updates/README.md: -------------------------------------------------------------------------------- 1 | # Ansible role: zmf_swmgmt_identify_missing_critical_updates 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_swmgmt_identify_missing_critical_updates`, to run the software instance missing critical updates report REST API. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_swmgmt_identify_missing_critical_updates.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2023 -------------------------------------------------------------------------------- /roles/zmf_swmgmt_identify_missing_critical_updates/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2023 2 | 3 | --- 4 | # defaults file for zmf_swmgmt_identify_missing_critical_updates 5 | async_thread_check_times: 60 6 | async_thread_check_delay: 1 7 | -------------------------------------------------------------------------------- /roles/zmf_swmgmt_identify_missing_critical_updates/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2023 2 | 3 | --- 4 | galaxy_info: 5 | author: Taylor Digilio 6 | description: Ansible role to complete the Software Management Missing Critical Updates Report REST API for a software instance. 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - softwaremanagement 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_swmgmt_identify_missing_fixcat_updates/README.md: -------------------------------------------------------------------------------- 1 | # Ansible role: zmf_swmgmt_identify_missing_fixcat_updates 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_swmgmt_identify_missing_fixcat_updates`, to run the software instance missing fixcat updates report REST API. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_swmgmt_identify_missing_fixcat_updates.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2023 -------------------------------------------------------------------------------- /roles/zmf_swmgmt_identify_missing_fixcat_updates/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2023 2 | 3 | --- 4 | # defaults file for zmf_swmgmt_identify_missing_fixcat_updates 5 | async_thread_check_times: 60 6 | async_thread_check_delay: 1 7 | -------------------------------------------------------------------------------- /roles/zmf_swmgmt_identify_missing_fixcat_updates/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2023 2 | 3 | --- 4 | galaxy_info: 5 | author: Taylor Digilio 6 | description: Ansible role to complete the Software Management Missing Fixcat Updates Report REST API for a software instance. 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - softwaremanagement 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_swmgmt_search_software_updates/README.md: -------------------------------------------------------------------------------- 1 | # Ansible role: zmf_swmgmt_search_software_updates 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_swmgmt_search_software_updates`, to run the software instance search software updates report REST API. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_swmgmt_search_software_updates.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2023 -------------------------------------------------------------------------------- /roles/zmf_swmgmt_search_software_updates/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2023 2 | 3 | --- 4 | # defaults file for zmf_swmgmt_search_software_updates 5 | async_thread_check_times: 60 6 | async_thread_check_delay: 1 7 | -------------------------------------------------------------------------------- /roles/zmf_swmgmt_search_software_updates/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2023 2 | 3 | --- 4 | galaxy_info: 5 | author: Taylor Digilio 6 | description: Ansible role to complete the Software Management Software Update Search Report REST API for a software instance. 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - softwaremanagement 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_swmgmt_zos_system_uuid/README.md: -------------------------------------------------------------------------------- 1 | # Ansible role: zmf_swmgmt_zos_system_uuid 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_swmgmt_zos_system_uuid`, to run the z/OS system UUID REST API. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_swmgmt_zos_system_uuid.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2024 -------------------------------------------------------------------------------- /roles/zmf_swmgmt_zos_system_uuid/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2024 2 | 3 | --- 4 | # defaults file for zmf_swmgmt_zos_system_uuid 5 | async_thread_check_times: 60 6 | async_thread_check_delay: 1 7 | -------------------------------------------------------------------------------- /roles/zmf_swmgmt_zos_system_uuid/docs/doc_zmf_swmgmt_zos_system_uuid: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2024 2 | 3 | 4 | DOCUMENTATION = r""" 5 | role: zmf_swmgmt_zos_system_uuid 6 | short_description: Retrieve the z/OS system UUID 7 | description: 8 | - > 9 | The B(IBM z/OSMF collection) provides an Ansible role, referred to as 10 | B(zmf_swmgmt_zos_system_uuid), to retrieve the z/OS system UUID for the 11 | specified system nickname. The UUID identifies the software instance 12 | object that corresponds to the installed software for the specified 13 | z/OSMF host system. The UUID can be used to uniquely identify a 14 | software instance object to be acted upon by other Ansible roles. 15 | author: 16 | - Taylor Digilio (Taylor.Digilio@ibm.com) 17 | options: 18 | zmf_host: 19 | description: 20 | - > 21 | Hostname of the z/OSMF server, specified in the inventory file 22 | or as an argument on the playbook command. 23 | required: True 24 | type: str 25 | zmf_port: 26 | description: 27 | - > 28 | Port number of the z/OSMF server. 29 | If z/OSMF is not using the default port, you need to specify a 30 | value for this parameter in the inventory file or as an argument on 31 | the playbook command. 32 | required: False 33 | type: str 34 | default: 443 35 | zmf_user: 36 | description: 37 | - User ID for authenticating with the z/OSMF server. 38 | - > 39 | This variable can be specified in the inventory file or as an argument on 40 | the playbook command. 41 | required: True 42 | type: str 43 | zmf_password: 44 | description: 45 | - Password to be used for authenticating with z/OSMF server. 46 | - > 47 | This variable can be specified in the inventory file or as an argument on 48 | the playbook command. 49 | required: True 50 | type: str 51 | system_nickname: 52 | description: 53 | - > 54 | Nickname of the z/OSMF host system. 55 | - > 56 | This variable can be specified in the inventory file or as an argument on 57 | the playbook command. 58 | required: True 59 | type: str 60 | remote_zmf_user: 61 | description: 62 | - > 63 | User ID for authenticating with a remote z/OSMF server. Used only to retrieve the UUID of 64 | a remote z/OSMF server. 65 | required: False 66 | type: str 67 | remote_zmf_password: 68 | description: 69 | - Password for authenticating with a remote z/OSMF server. 70 | required: False 71 | type: str 72 | proxy_zmf_user: 73 | description: 74 | - User ID for authenticating with an HTTP proxy server. 75 | required: False 76 | type: str 77 | proxy_zmf_password: 78 | description: 79 | - Password for authenticating with an HTTP proxy server. 80 | required: False 81 | type: str 82 | notes: 83 | - > 84 | The given example assumes you have an inventory file 85 | I(inventory.yml) that contains the values for the variables described above, 86 | such as z/OSMF host server, userid, password, system, and response file name. 87 | - > 88 | Command syntax to call a playbook using an inventory file: 89 | C(ansible-playbook -i inventory software_management_system_uuid_CICDtest1.yml) 90 | - > 91 | Command syntax to call a playbook using command arguments: 92 | C(ansible-playbook software_management_system_uuid_CICDtest1.yml -e zmf_user=zosmf** 93 | -e zmf_password=zosmf**) 94 | - > 95 | When the role is executed, a message shown in following example is 96 | displayed, C("msg": "Output filename= /tmp/xxx/zos_system_uuid_response.json"). 97 | This message includes a file path and file name where the z/OS system UUID 98 | is saved. 99 | - > 100 | Refer to https://www.ibm.com/docs/en/zos/3.1.0?topic=services-retrieve-zos-system-uuid 101 | for more information on the REST API's request and response JSON. 102 | 103 | """ 104 | 105 | EXAMPLES = r""" 106 | - name: sample of retrieving the z/OS system UUID 107 | hosts: sampleHost 108 | gather_facts: no 109 | collections: 110 | - ibm.ibm_zosmf 111 | 112 | tasks: 113 | - include_role : 114 | name: zmf_swmgmt_zos_system_uuid 115 | 116 | """ 117 | 118 | # Roles don't return anything. 119 | # But RETURN block must be defined for doc extraction tooling to avoid error. 120 | # The content in RETURN block will not be display in doc-site. 121 | RETURN = r""" 122 | changed: 123 | description: Indicates if any change is made during the role operation. 124 | returned: always 125 | type: bool 126 | """ -------------------------------------------------------------------------------- /roles/zmf_swmgmt_zos_system_uuid/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2024 2 | 3 | --- 4 | galaxy_info: 5 | author: Taylor Digilio 6 | description: Ansible role to complete the Software Management z/OS System UUID REST API. 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - softwaremanagement 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_workflow_complete/README.md: -------------------------------------------------------------------------------- 1 | # Ansible role: zmf_workflow_complete 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_workflow_complete`, to complete a z/OS workflow, either forcibly or idempotently. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_workflow_complete.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2021 -------------------------------------------------------------------------------- /roles/zmf_workflow_complete/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | force_complete: false 5 | complete_check_times: 10 6 | complete_check_delay: 5 7 | -------------------------------------------------------------------------------- /roles/zmf_workflow_complete/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | galaxy_info: 5 | author: Yang Cao , Yun Juan Yang 6 | description: Ansible role to complete a z/OS workflow forcibly or idempotently. 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - workflow 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_workflow_complete/tasks/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | - name: Initialize final_result 6 | ansible.builtin.set_fact: 7 | final_result: {'workflow_name': "{{ workflow_name }}"} 8 | 9 | - name: Check whether a workflow instance with the given name already exists 10 | ibm.ibm_zosmf.zmf_workflow: 11 | state: "existed" 12 | zmf_host: "{{ zmf_host }}" 13 | zmf_port: "{{ zmf_port | default(-1) }}" 14 | zmf_user: "{{ zmf_user | default() }}" 15 | zmf_password: "{{ zmf_password | default() }}" 16 | zmf_crt: "{{ zmf_crt | default() }}" 17 | zmf_key: "{{ zmf_key | default() }}" 18 | workflow_name: "{{ workflow_name }}" 19 | workflow_file: "{{ workflow_file | default() }}" 20 | workflow_host: "{{ inventory_hostname | default() }}" 21 | workflow_owner: "{{ workflow_owner | default() }}" 22 | workflow_file_system: "{{ workflow_file_system | default() }}" 23 | workflow_vars_file: "{{ workflow_vars_file | default() }}" 24 | workflow_vars: "{{ workflow_vars | default({}) }}" 25 | workflow_resolve_global_conflict_by_using: "{{ workflow_resolve_global_conflict_by_using | default('global') }}" 26 | workflow_comments: "{{ workflow_comments | default() }}" 27 | workflow_assign_to_owner: "{{ workflow_assign_to_owner | default(True) }}" 28 | workflow_access_type: "{{ workflow_access_type | default('Public') }}" 29 | workflow_account_info: "{{ workflow_account_info | default() }}" 30 | workflow_job_statement: "{{ workflow_job_statement | default() }}" 31 | workflow_delete_completed_jobs: "{{ workflow_delete_completed_jobs | default(False) }}" 32 | delegate_to: localhost 33 | register: compare_result 34 | when: not force_complete 35 | 36 | - name: Delete the existing workflow instance if force complete or it has different definition file, variables or properties 37 | ibm.ibm_zosmf.zmf_workflow: 38 | state: "deleted" 39 | zmf_host: "{{ zmf_host }}" 40 | zmf_port: "{{ zmf_port | default(-1) }}" 41 | zmf_user: "{{ zmf_user | default() }}" 42 | zmf_password: "{{ zmf_password | default() }}" 43 | zmf_crt: "{{ zmf_crt | default() }}" 44 | zmf_key: "{{ zmf_key | default() }}" 45 | workflow_name: "{{ workflow_name }}" 46 | workflow_key: "{{ compare_result.workflow_key | default() }}" 47 | delegate_to: localhost 48 | register: delete_result 49 | when: (force_complete) or (compare_result.workflow_key and not compare_result.same_workflow_instance) 50 | 51 | - name: Reset workflow_key if the existing workflow instance is deleted 52 | ansible.builtin.set_fact: 53 | compare_result: {'workflow_key':'', 'workflow_completed':false} 54 | when: ('skipped' not in delete_result) and (delete_result.deleted) 55 | 56 | - name: Create the workflow instance if not exist and start it 57 | ibm.ibm_zosmf.zmf_workflow: 58 | state: "started" 59 | zmf_host: "{{ zmf_host }}" 60 | zmf_port: "{{ zmf_port | default(-1) }}" 61 | zmf_user: "{{ zmf_user | default() }}" 62 | zmf_password: "{{ zmf_password | default() }}" 63 | zmf_crt: "{{ zmf_crt | default() }}" 64 | zmf_key: "{{ zmf_key | default() }}" 65 | workflow_name: "{{ workflow_name }}" 66 | workflow_file: "{{ workflow_file | default() }}" 67 | workflow_host: "{{ inventory_hostname | default() }}" 68 | workflow_owner: "{{ workflow_owner | default() }}" 69 | workflow_file_system: "{{ workflow_file_system | default() }}" 70 | workflow_vars_file: "{{ workflow_vars_file | default() }}" 71 | workflow_vars: "{{ workflow_vars | default({}) }}" 72 | workflow_resolve_global_conflict_by_using: "{{ workflow_resolve_global_conflict_by_using | default('global') }}" 73 | workflow_comments: "{{ workflow_comments | default() }}" 74 | workflow_assign_to_owner: "{{ workflow_assign_to_owner | default(True) }}" 75 | workflow_access_type: "{{ workflow_access_type | default('Public') }}" 76 | workflow_account_info: "{{ workflow_account_info | default() }}" 77 | workflow_job_statement: "{{ workflow_job_statement | default() }}" 78 | workflow_delete_completed_jobs: "{{ workflow_delete_completed_jobs | default(False) }}" 79 | workflow_resolve_conflict_by_using: "{{ workflow_resolve_conflict_by_using | default('outputFileValue') }}" 80 | workflow_step_name: "{{ workflow_step_name | default() }}" 81 | workflow_perform_subsequent: "{{ workflow_perform_subsequent | default(True) }}" 82 | workflow_notification_url: "{{ workflow_notification_url | default() }}" 83 | workflow_key: "{{ compare_result.workflow_key | default() }}" 84 | delegate_to: localhost 85 | register: start_result 86 | when: (force_complete) or ('workflow_completed' not in compare_result) or (not compare_result.workflow_completed) 87 | 88 | - name: Periodically check status of the workflow instance and return final result 89 | ibm.ibm_zosmf.zmf_workflow: 90 | state: "check" 91 | zmf_host: "{{ zmf_host }}" 92 | zmf_port: "{{ zmf_port | default(-1) }}" 93 | zmf_user: "{{ zmf_user | default() }}" 94 | zmf_password: "{{ zmf_password | default() }}" 95 | zmf_crt: "{{ zmf_crt | default() }}" 96 | zmf_key: "{{ zmf_key | default() }}" 97 | workflow_key: "{{ start_result.workflow_key | default(compare_result.workflow_key) }}" 98 | delegate_to: localhost 99 | register: result 100 | until: (result is failed) or (not result.workflow_waiting) 101 | retries: "{{ complete_check_times }}" 102 | delay: "{{ complete_check_delay }}" 103 | 104 | - name: Update final_result 105 | ansible.builtin.set_fact: 106 | final_result: "{{ final_result | combine({\ 107 | 'workflow_name': result.workflow_name, \ 108 | 'workflow_key': start_result.workflow_key | default(compare_result.workflow_key), \ 109 | 'workflow_completed': result.workflow_completed, \ 110 | 'msg': result.message}) }}" 111 | 112 | - name: Fail if the workflow instance is not completed 113 | ansible.builtin.fail: 114 | msg: "{{ result.message }}" 115 | when: not result.workflow_completed 116 | 117 | - name: Return final_result 118 | ansible.builtin.debug: 119 | msg: "{{ final_result }}" 120 | -------------------------------------------------------------------------------- /roles/zmf_zmsc_run_management_service/README.md: -------------------------------------------------------------------------------- 1 | # Ansible Role: zmf_zmsc_run_management_service 2 | The collection [ibm_zosmf](../../README.md) provides an [Ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html), referred to as `zmf_zmsc_run_management_service`, to to run a z/OS management service published in z/OS Management Services Catalog. 3 | 4 | For guides and reference, see [Docs Site](https://ibm.github.io/z_ansible_collections_doc/ibm_zosmf/docs/source/roles/zmf_zmsc_run_management_service.html). 5 | 6 | ## Copyright 7 | © Copyright IBM Corporation 2023 8 | -------------------------------------------------------------------------------- /roles/zmf_zmsc_run_management_service/defaults/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | # defaults file for zmf_zmsc_run_management_service 5 | 6 | # The value for property instance_record_dir identifies the file path in local system where the management 7 | # service result (in json) will be stored 8 | instance_record_dir: "/tmp" 9 | # The value for property api_polling_retry_count identifies max times of status polling before task fail and exit 10 | api_polling_retry_count: 50 11 | # The value for property api_polling_interval_seconds identifies interval in seconds between each 12 | # api_polling_retry_count polling 13 | api_polling_interval_seconds: 10 14 | # The value for property zmf_port identifies the port number that z/OSMF uses. Default port number is 443. 15 | zmf_port: 443 16 | -------------------------------------------------------------------------------- /roles/zmf_zmsc_run_management_service/docs/doc_zmf_zmsc_run_management_service: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2023 2 | 3 | 4 | DOCUMENTATION = r""" 5 | role: zmf_zmsc_run_management_service 6 | short_description: Role runs a z/OS management service 7 | description: 8 | - > 9 | The B(IBM z/OSMF collection) provides an Ansible role, referred to as 10 | B(zmf_zmsc_run_management_service), to run a z/OS management service 11 | published in B(z/OS Management Services Catalog). 12 | - > 13 | Management Service referenced by playbook must be published in 14 | I(z/OS Management Services Catalog). 15 | - > 16 | This role will generate a unique JSON file that holds service 17 | instance information. The file location is in following format, 18 | C(/-.json) 19 | author: 20 | - Hiren Shah (@shreeji818) 21 | options: 22 | zmf_host: 23 | description: 24 | - > 25 | Hostname of the z/OSMF server, specified in the inventory file 26 | or vars file. 27 | required: True 28 | type: str 29 | zmf_port: 30 | description: 31 | - > 32 | Port number of the z/OSMF server. 33 | If z/OSMF is not using the default port, you need to specify 34 | value for this parameter in the inventory file or vars file. 35 | required: False 36 | type: str 37 | default: 443 38 | zmf_user: 39 | description: 40 | - User name to be used for authenticating with the z/OSMF server. 41 | - > 42 | This variable can be specified in the inventory file or vars 43 | file, or prompted when playbook is run. 44 | required: True 45 | type: str 46 | zmf_password: 47 | description: 48 | - Password to be used for authenticating with z/OSMF server. 49 | - > 50 | This variable can be specified in the inventory file or vars 51 | file, or prompted when playbook is run. 52 | required: True 53 | type: str 54 | instance_record_dir: 55 | description: 56 | - > 57 | Directory path that the run management service role uses to capture 58 | various information (in JSON format) about the service 59 | instance. 60 | - > 61 | On many system default value C("/tmp") used for this variable 62 | may not be acceptable because C("/tmp") directory can be 63 | transient on the system. 64 | In such cases it is recommended to specify non-default value for 65 | this variable. 66 | This variable can be specified in the inventory file or vars 67 | file. 68 | required: False 69 | type: str 70 | default: /tmp 71 | catalog_service_name: 72 | description: 73 | - Service name of the management service to be run. 74 | required: True 75 | type: str 76 | category_name: 77 | description: 78 | - Category name associated with the management service to be run. If there after 79 | are multiple managment services with same name, this parameter is required to 80 | uniquely identify management service to be run. 81 | required: False 82 | type: str 83 | change_record_number: 84 | description: 85 | - > 86 | Change record number associated with the change being performed by 87 | management service. This information is required when z/OS Management 88 | Service Catalog is configured to require change record number to run 89 | any management service. 90 | required: False 91 | type: str 92 | default: null 93 | job_statement: 94 | description: 95 | - > 96 | Job statement to be used when running a management service. 97 | required: False 98 | type: str 99 | default: null 100 | system_nickname: 101 | description: 102 | - System nickname as specified in the z/OSMF Systems table. 103 | - > 104 | If this variable is not specified, management service will run on 105 | the system where z/OSMF is currently running. 106 | required: False 107 | type: str 108 | default: null 109 | input_vars: 110 | description: 111 | - > 112 | Input variable names and values for the management service to be 113 | run. 114 | - > 115 | This variable is required if management service expects specific 116 | inputs from user. 117 | This is a json variable and needs to be in following 118 | format, C({ "var1":"value1","var2":"value2",...}) 119 | required: False 120 | type: json 121 | default: null 122 | api_polling_retry_count: 123 | description: 124 | - > 125 | Total retry attempts allowed before the role exits with failure, 126 | waiting on the instance action to complete. 127 | - > 128 | This variable can be specified in the inventory file or vars 129 | file. 130 | required: False 131 | type: int 132 | default: 50 133 | api_polling_interval_seconds: 134 | description: 135 | - > 136 | Interval time (in seconds) for each polling request. 137 | - > 138 | This variable can be specified in the inventory file or vars 139 | file. 140 | required: False 141 | type: int 142 | default: 10 143 | notes: 144 | - > 145 | The given example assumes that you have an inventory file 146 | I(inventory.yml) and host vars I(sampleHost.yml) with appropriate values 147 | to identify the target z/OSMF server end point. 148 | - > 149 | When playbooks completes, a message shown in following example is 150 | displayed, C("msg": "Instance record saved at: /tmp/xxx/xxx.json"). 151 | This message includes a file path and file name where instance specific 152 | information is returned. 153 | 154 | """ 155 | 156 | EXAMPLES = r""" 157 | - name: Run z/OS Management Service 158 | hosts: sampleHost 159 | gather_facts: no 160 | collections: 161 | - ibm.ibm_zosmf 162 | tasks: 163 | - include_role: 164 | name: zmf_zmsc_run_management_service 165 | vars: 166 | catalog_service_namme: "" 167 | category_name: "" 168 | change_record_number: "" 169 | job_statement: "" 170 | systems_name: "" 171 | input_vars: "" 172 | 173 | """ 174 | 175 | # Roles don't return anything. 176 | # But RETURN block must be defined for doc extraction tooling to avoid error. 177 | # The content in RETURN block will not be display in doc-site. 178 | RETURN = r""" 179 | changed: 180 | description: Indicates if any change is made during the role operation. 181 | returned: always 182 | type: bool 183 | """ -------------------------------------------------------------------------------- /roles/zmf_zmsc_run_management_service/meta/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | --- 4 | galaxy_info: 5 | author: Hiren Shah 6 | description: Run z/OS Management Service 7 | company: IBM 8 | min_ansible_version: 2.9 9 | galaxy_tags: 10 | - ibm 11 | - z 12 | - zos 13 | - zosmf 14 | - zmsc 15 | license: 16 | - Apache-2.0 17 | platforms: 18 | - name: GenericLinux 19 | versions: 20 | - all 21 | dependencies: [] 22 | -------------------------------------------------------------------------------- /roles/zmf_zmsc_run_management_service/tasks/instance_dir_util.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2023 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | 6 | - name: Get instance record directory 7 | ansible.builtin.stat: 8 | path: "{{ instance_record_dir }}/{{ inventory_hostname }}" 9 | connection: local 10 | register: target_dir 11 | 12 | - name: "Check {{ instance_record_dir }}/{{ inventory_hostname }} status" 13 | ansible.builtin.debug: 14 | msg: "{{ instance_record_dir }}/{{ inventory_hostname }} exists" 15 | when: target_dir.stat.exists 16 | 17 | - name: "Create {{ instance_record_dir }}/{{ inventory_hostname }} when not exist" 18 | ansible.builtin.file: 19 | path: "{{ instance_record_dir }}/{{ inventory_hostname }}" 20 | state: directory 21 | mode: '0755' 22 | connection: local 23 | when: not target_dir.stat.exists 24 | -------------------------------------------------------------------------------- /roles/zmf_zmsc_run_management_service/tasks/loop_service_state_check.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) 3 | 4 | --- 5 | - name: Examining service progress 6 | block: 7 | - name: Pause 8 | ansible.builtin.pause: 9 | prompt: "Waiting {{ api_polling_interval_seconds }} seconds before next polling workflow progress status" 10 | seconds: "{{ api_polling_interval_seconds }}" 11 | 12 | - name: Retrieve management service instance 13 | ansible.builtin.uri: 14 | url: "https://{{ zmf_host }}:{{ zmf_port }}/zosmf/mgmt-services/rest/service-instances/{{ instance_object_id }}" 15 | user: "{{ zmf_user | trim }}" 16 | password: "{{ zmf_password | trim }}" 17 | force_basic_auth: true 18 | headers: 19 | Host: "{{ zmf_host }}" 20 | Origin: "https://{{ zmf_host }}" 21 | method: GET 22 | status_code: "200" 23 | validate_certs: false 24 | delegate_to: localhost 25 | register: results 26 | no_log: true 27 | 28 | - name: Set service_instance_state as fact 29 | ansible.builtin.set_fact: 30 | service_instance_state: "{{ results.json.siStatus }}" 31 | 32 | - name: Check if service instance failed 33 | ansible.builtin.fail: 34 | msg: "**** Service Instance Failed ****" 35 | when: results.json.siStatus == "failed" 36 | 37 | - name: Repeat if service instance is not complete 38 | block: 39 | 40 | - name: Set the retry count for verification progress 41 | ansible.builtin.set_fact: 42 | retry_count: "{{ 1 if retry_count is undefined else retry_count | int + 1 }}" 43 | max_retry: "{{ api_polling_retry_count }}" 44 | 45 | - name: Display current polling count 46 | ansible.builtin.debug: 47 | msg: "Polling {{ retry_count }} of {{ api_polling_retry_count }} tries..." 48 | 49 | 50 | - name: "Check service instance process (ignore the failure of this task), skip if complete" 51 | ansible.builtin.debug: 52 | msg: "Ignore and retry" 53 | when: 54 | - results.json.siStatus != "completed" 55 | 56 | always: 57 | - name: Fail if reached max polling count 58 | ansible.builtin.fail: 59 | msg: "Reached max retry limit {{ api_polling_retry_count }} while workflow still not at 100% complete, aborting..." 60 | when: retry_count|int == max_retry 61 | 62 | - name: Include tasks 63 | ansible.builtin.include_tasks: loop_service_state_check.yml 64 | when: 65 | - results.json.siStatus != "completed" 66 | -------------------------------------------------------------------------------- /tests/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/ibm_zosmf/afe6ba0d4f80ed6f09ddb5b87fc12943cbb4ccd0/tests/.DS_Store -------------------------------------------------------------------------------- /tests/CICD/playbooks/README.md: -------------------------------------------------------------------------------- 1 | # FVT Test Cases 2 | The collection [ibm_zosmf](../../../README.md) provides a directory of [Ansible playbook](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#playbooks-intro), which contains various sample playbooks to functional test modules and roles. 3 | 4 | ## Copyright 5 | © Copyright IBM Corporation 2021 -------------------------------------------------------------------------------- /tests/CICD/playbooks/ansible.cfg: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | # Config file for ansible: 4 | # https://docs.ansible.com/ansible/latest/reference_appendices/config.html 5 | 6 | [defaults] 7 | inventory = hosts 8 | collections_paths = ~/.ansible/collections:/usr/share/ansible/collections 9 | -------------------------------------------------------------------------------- /tests/CICD/playbooks/cpm_complete_CICDtest1.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | # This sample playbook demonstrates using roles `zmf_cpm_provision_software_service`, 4 | # 'zmf_cpm_manage_software_instance' and 'zmf_remove_software_instance' to provision 5 | # a sample service instance, deprovision the instance and remove the deprovisioned instance. 6 | # This sample playbook also tests new roles 'zmf_cpm_list_software_templates', 7 | # 'zmf_cpm_create_software_instance' and 'zmf_cpm_get_software_instance' 8 | # Example: 9 | # ansible-playbook -i hosts cpm_complete_CICDtest1.yml 10 | 11 | - name: Test all roles provided by cpm 12 | # 13 | # Test zmf_cpm_provision_software_service role 14 | # 15 | hosts: ClientCtr 16 | collections: 17 | - ibm.ibm_zosmf 18 | gather_facts: false 19 | 20 | tasks: 21 | - include_role: 22 | name: zmf_cpm_provision_software_service 23 | vars: 24 | # The value for property cpm_template_name 25 | # which identifies the template (software 26 | # service) user wants to provision with 27 | # Cloud Provisioning & Management 28 | cpm_template_name: 'AnsibleFVT' 29 | # The value for property domain_name which 30 | # identifies CP&M domain in which specified 31 | # template is defined 32 | domain_name: 'default' 33 | 34 | - name: Save instance info file path 35 | ansible.builtin.set_fact: 36 | instance_file_path: "{{ instance_info_json_path }}" 37 | 38 | # 39 | # Test zmf_cpm_manage_software_instance role 40 | # 41 | - hosts: ClientCtr 42 | collections: 43 | - ibm.ibm_zosmf 44 | gather_facts: false 45 | tasks: 46 | - include_role: 47 | name: zmf_cpm_manage_software_instance 48 | vars: 49 | instance_action_name: "deprovision" 50 | instance_info_json_path: "{{ instance_file_path }}" 51 | # 52 | # Test zmf_cpm_remove_software_instance role 53 | # 54 | - hosts: ClientCtr 55 | collections: 56 | - ibm.ibm_zosmf 57 | gather_facts: false 58 | tasks: 59 | - include_role: 60 | name: zmf_cpm_remove_software_instance 61 | vars: 62 | instance_info_json_path: "{{ instance_file_path }}" 63 | 64 | # 65 | # Test zmf_cpm_list_software_templates role 66 | # 67 | - hosts: ClientCtr 68 | collections: 69 | - ibm.ibm_zosmf 70 | gather_facts: false 71 | vars: 72 | # will store template json information globally 73 | # thru the playbook 74 | - name: template_info_json_path 75 | 76 | tasks: 77 | - include_role: 78 | name: zmf_cpm_list_software_templates 79 | 80 | - name: Set templates as fact 81 | ansible.builtin.set_fact: 82 | templates: null 83 | 84 | - name: Gather name of published templates and domains 85 | vars: 86 | template_info_json: "{{ lookup('file', template_info_json_path) }}" 87 | 88 | ansible.builtin.set_fact: 89 | templates: "{{ item.name }}:{{ item['domain-name'] }}, {{ templates }}" 90 | 91 | loop: "{{ template_info_json['psc-list'] }}" 92 | 93 | - name: Display published templates 94 | ansible.builtin.debug: 95 | msg: "Published Template:Domain are : {{ templates }}" 96 | 97 | - name: Clean instance record file 98 | ansible.builtin.file: 99 | state: absent 100 | path: "{{ template_info_json_path }}" 101 | delegate_to: localhost 102 | # 103 | # Test zmf_cpm_create_software_instance role 104 | # 105 | - hosts: ClientCtr 106 | collections: 107 | - ibm.ibm_zosmf 108 | gather_facts: false 109 | tasks: 110 | - include_role: 111 | name: zmf_cpm_create_software_instance 112 | vars: 113 | system_name: "P00" 114 | sysplex_name: "SVPLEX6" 115 | external_name: "DB2B" 116 | software_type: "Db2" 117 | vendor_name: "IBM" 118 | product_version: "V12" 119 | instance_description: "Db2 Subsystem for DevTeam" 120 | instance_owner: "IBMUSER" 121 | instance_provider: "IBMUSER" 122 | instance_state: "deprovisioned" 123 | 124 | - name: Save instance info file path 125 | ansible.builtin.set_fact: 126 | instance_file_path: "{{ instance_info_json_path }}" 127 | # 128 | # Test zmf_cpm_create_software_instance role 129 | # 130 | - hosts: ClientCtr 131 | collections: 132 | - ibm.ibm_zosmf 133 | gather_facts: false 134 | 135 | tasks: 136 | - include_role: 137 | name: zmf_cpm_get_software_instance 138 | vars: 139 | external_software_name: "DB2B" 140 | 141 | - name: Set Provider 142 | vars: 143 | instance_info_json: "{{ lookup('file', instance_info_json_path) | from_json }}" 144 | 145 | ansible.builtin.set_fact: 146 | PROV: "{{ instance_info_json['registry-info']['provider'] }}" 147 | 148 | - name: Display Provider 149 | ansible.builtin.debug: 150 | msg: "Software instance provider is : {{ PROV }}" 151 | 152 | # Cleanup software instance created in registry via 153 | # zmf_cpm_remove_software_instance role 154 | # 155 | - hosts: ClientCtr 156 | collections: 157 | - ibm.ibm_zosmf 158 | gather_facts: false 159 | tasks: 160 | - include_role: 161 | name: zmf_cpm_remove_software_instance 162 | vars: 163 | instance_info_json_path: "{{ instance_file_path }}" 164 | -------------------------------------------------------------------------------- /tests/CICD/playbooks/group_vars/ClientCtr.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | # The value for property zmf_host is the hostname of the system on which z/OSMF server is running on. 4 | # The value for property zmf_port is the port number of z/OSMF server. 5 | 6 | # zmf_host: your.host.name 7 | # zmf_port: port_number 8 | 9 | # The value for property zmf_user is your username of z/OSMF. 10 | # The value for property zmf_password is the password of your username of z/OSMF. 11 | # `zmf_user` and `zmf_password` are prompted to input when running a playbook 12 | # zmf_user: 13 | # zmf_password: 14 | 15 | # Client certificate is supported by specifying the location of client certificate and key files on control node via zmf_crt and zmf_key. 16 | # If below variables are specified, then the module and role will use client certificate to login instead of using username/password even those variables are specified. 17 | # zmf_crt: 18 | # zmf_key: 19 | 20 | instance_record_dir: "/tmp" # The value for property instance_record_dir identifies the file path in local system where the provision result (in json) will be stored 21 | api_polling_retry_count: 50 # The value for property api_polling_retry_count identifies max times of status polling before task fail and exit 22 | api_polling_interval_seconds: 7 # The value for property api_polling_interval_seconds identifies interval in seconds between each api_polling_retry_count polling -------------------------------------------------------------------------------- /tests/CICD/playbooks/group_vars/sca.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | # The value for property zmf_host is the hostname of the system on which z/OSMF server is running on. 4 | # The value for property zmf_port is the port number of z/OSMF server. 5 | 6 | # zmf_host: your.host.name 7 | # zmf_port: port_number 8 | 9 | # The value for property zmf_user is your username of z/OSMF. 10 | # The value for property zmf_password is the password of your username of z/OSMF. 11 | # `zmf_user` and `zmf_password` are prompted to input when running a playbook 12 | # zmf_user: 13 | # zmf_password: 14 | 15 | # Client certificate is supported by specifying the location of client certificate and key files on control node via zmf_crt and zmf_key. 16 | # If below variables are specified, then the module and role will use client certificate to login instead of using username/password even those variables are specified. 17 | # zmf_crt: 18 | # zmf_key: 19 | 20 | # target_userid: Target user or group id to be validated 21 | # path: Path of the remote security requirement file 22 | # path_local: Path of the local security requirement file 23 | 24 | target_userid: ibmuser 25 | path: /global/zosmf/IZUDFLT0/data/sca_2_failed.json 26 | path_local: sca_1_passed.json -------------------------------------------------------------------------------- /tests/CICD/playbooks/group_vars/swmgmt.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2023 2 | 3 | # The value for property zmf_host is the hostname of the system on which z/OSMF server is running on. 4 | # The value for property zmf_port is the port number of z/OSMF server. 5 | 6 | # zmf_host: your.host.name 7 | # zmf_port: port_number 8 | 9 | # The value for property zmf_user is your username of z/OSMF. 10 | # The value for property zmf_password is the password of your username of z/OSMF. 11 | # `zmf_user` and `zmf_password` are prompted to input when running a playbook 12 | # zmf_user: 13 | # zmf_password: 14 | 15 | software_instance_name: test 16 | system_nickname: P00 17 | missing_critical_updates_response_file: MissingCriticalUpdatesReport.json 18 | missing_fixcat_updates_response_file: MissingFixcatUpdatesReport.json 19 | search_software_updates_response_file: SoftwareUpdateSearchReport.json 20 | updates: 21 | - AC00001 22 | - UH10003 23 | - FOOBAR1 24 | zones: ["*"] 25 | entries: ["*"] 26 | subentries: ["*"] 27 | filter: "INSTALLDATE >= '23203'" 28 | csi_query_response_file: SoftwareCsiQueryReport.json -------------------------------------------------------------------------------- /tests/CICD/playbooks/group_vars/workflow.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | # The value for property zmf_host is the hostname of the system on which z/OSMF server is running on. 4 | # The value for property zmf_port is the port number of z/OSMF server. 5 | 6 | # zmf_host: your.host.name 7 | # zmf_port: port_number 8 | 9 | # The value for property zmf_user is your username of z/OSMF. 10 | # The value for property zmf_password is the password of your username of z/OSMF. 11 | # `zmf_user` and `zmf_password` are prompted to input when running a playbook 12 | # zmf_user: 13 | # zmf_password: 14 | 15 | # Client certificate is supported by specifying the location of client certificate and key files on control node via zmf_crt and zmf_key. 16 | # If below variables are specified, then the module and role will use client certificate to login instead of using username/password even those variables are specified. 17 | # zmf_crt: 18 | # zmf_key: 19 | -------------------------------------------------------------------------------- /tests/CICD/playbooks/hosts: -------------------------------------------------------------------------------- 1 | [workflow] 2 | P00 3 | 4 | [sca] 5 | P00 6 | 7 | [ClientCtr] 8 | P00 9 | 10 | [swmgmt] 11 | P00 12 | 13 | [cpm1] 14 | P01 15 | -------------------------------------------------------------------------------- /tests/CICD/playbooks/sca_1_passed.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceItems": [{ 3 | "resourceProfile" : "IZUP01SF.ZOSMF.CONFIGURATION.SECURITY_ASSISTANT", 4 | "resourceClass" : "ZMFAPLA", 5 | "access" : "READ" 6 | }] 7 | } 8 | -------------------------------------------------------------------------------- /tests/CICD/playbooks/sca_CICDtest1.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | # This sample playbook demonstrates using module `zmf_sca` to complete a z/OS security validation and audit. 4 | # Example: 5 | # ansible-playbook -i hosts sample_sca.yml 6 | 7 | - name: sample of z/OS security validation and security audit 8 | hosts: sca 9 | connection: local 10 | gather_facts: no 11 | collections: 12 | - ibm.ibm_zosmf 13 | tasks: 14 | - zmf_authenticate: 15 | zmf_host: "{{ zmf_host }}" 16 | zmf_port: "{{ zmf_port }}" 17 | zmf_user: "{{ zmf_user }}" 18 | zmf_password: "{{ zmf_password }}" 19 | register: result_auth 20 | - name: Run security validation and expect all requirements are satisified 21 | zmf_sca: 22 | zmf_credential: "{{ result_auth }}" 23 | location: local # The security requirement file is in localhost 24 | path_of_security_requirements: "{{path_local}}" # Path of the local security requirement file 25 | target_userid: "{{target_userid}}" # Target user /group id to be validated 26 | register: result 27 | - ansible.builtin.debug: var=result 28 | 29 | - name: Run security validation and expect no access to any items 30 | zmf_sca: 31 | zmf_credential: "{{ result_auth }}" 32 | path_of_security_requirements: "{{path}}" # Path of the remote security requirement file 33 | expected_result: "all-failed" # Expect no access to any security resources mentioned in the security requirement file 34 | target_userid: "{{target_userid}}" # Target user or group id to be validated 35 | register: result 36 | - ansible.builtin.debug: var=result 37 | 38 | - name: Run security requirements provision and expect all requirements are satisified 39 | zmf_sca: 40 | state: "provisioned" 41 | zmf_credential: "{{ result_auth }}" 42 | location: local # The security requirement file is in localhost 43 | path_of_security_requirements: "{{path_local}}" # Path of the local security requirement file 44 | target_userid: "{{target_userid}}" # Target user or group id to be validated 45 | register: result 46 | - ansible.builtin.debug: var=result 47 | -------------------------------------------------------------------------------- /tests/CICD/playbooks/software_management_csi_query_CICDtest1.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2024 2 | # This playbook demonstrates using roles: 3 | # 'zmf_swmgmt_zos_system_uuid', and 'zmf_swmgmt_csi_query' 4 | # to query the global zone CSI data set associated with 5 | # the z/OS system's UUID. 6 | 7 | ##################################################################################### 8 | # PLAY #1: Retrieve the z/OS system's UUID. # 9 | ##################################################################################### 10 | - name: Retrieve the z/OS system UUID 11 | hosts: swmgmt 12 | gather_facts: false 13 | collections: 14 | - ibm.ibm_zosmf 15 | tasks: 16 | - name: Retrieve the z/OS system UUID 17 | include_role: 18 | name: zmf_swmgmt_zos_system_uuid 19 | 20 | ####################################################################################### 21 | # PLAY #2: Query the global zone CSI data set associated with the z/OS system's UUID. # 22 | ####################################################################################### 23 | - name: Query a CSI data set 24 | hosts: swmgmt 25 | gather_facts: false 26 | collections: 27 | - ibm.ibm_zosmf 28 | tasks: 29 | - name: Query a CSI data set 30 | include_role: 31 | name: zmf_swmgmt_csi_query 32 | -------------------------------------------------------------------------------- /tests/CICD/playbooks/software_management_reports_CICDtest1.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2023 2 | # This playbook demonstrates using roles: 3 | # 'zmf_swmgmt_identify_missing_critical_updates', 4 | # 'zmf_swmgmt_identify_missing_fixcat_updates', 5 | # and 'zmf_swmgmt_search_software_updates' to complete the software management 6 | # software instance report REST APIs. 7 | 8 | ####################################################################################### 9 | # PLAY #1: Identify missing critical software updates for a software instance. # 10 | ####################################################################################### 11 | - name: Identify Missing Critical Software Updates for a Software Instance 12 | hosts: swmgmt 13 | gather_facts: false 14 | collections: 15 | - ibm.ibm_zosmf 16 | tasks: 17 | - name: Identify missing critical updates 18 | include_role: 19 | name: zmf_swmgmt_identify_missing_critical_updates 20 | 21 | ##################################################################################### 22 | # PLAY #2: Identify missing fixcat software updates for a software instance. # 23 | ##################################################################################### 24 | - name: Identify Missing Fixcat Software Updates for a Software Instance 25 | hosts: swmgmt 26 | gather_facts: false 27 | collections: 28 | - ibm.ibm_zosmf 29 | tasks: 30 | - name: Identify missing fixcat updates 31 | include_role: 32 | name: zmf_swmgmt_identify_missing_fixcat_updates 33 | 34 | ##################################################################################### 35 | # PLAY #3: Search a software instance for software updates. # 36 | ##################################################################################### 37 | - name: Search a Software Instance for Software Updates 38 | hosts: swmgmt 39 | gather_facts: false 40 | collections: 41 | - ibm.ibm_zosmf 42 | tasks: 43 | - name: Search software updates 44 | include_role: 45 | name: zmf_swmgmt_search_software_updates 46 | -------------------------------------------------------------------------------- /tests/CICD/playbooks/software_management_system_uuid_CICDtest1.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2024 2 | # This playbook demonstrates using roles: 3 | # 'zmf_swmgmt_zos_system_uuid', 'zmf_swmgmt_identify_missing_critical_updates', 4 | # 'zmf_swmgmt_identify_missing_fixcat_updates', and 'zmf_swmgmt_search_software_updates' 5 | # to complete the software management software instance report REST APIs on the global 6 | # zone CSI data set associated with the z/OS system's UUID. 7 | 8 | ##################################################################################### 9 | # PLAY #1: Retrieve the z/OS system's UUID. # 10 | ##################################################################################### 11 | - name: Retrieve the z/OS system UUID 12 | hosts: swmgmt 13 | gather_facts: false 14 | collections: 15 | - ibm.ibm_zosmf 16 | tasks: 17 | - name: Retrieve the z/OS system UUID 18 | include_role: 19 | name: zmf_swmgmt_zos_system_uuid 20 | 21 | ##################################################################################### 22 | # PLAY #2: Identify missing critical software updates for the z/OS system's UUID. # 23 | ##################################################################################### 24 | - name: Identify Missing Critical Software Updates for the z/OS system's UUID 25 | hosts: swmgmt 26 | gather_facts: false 27 | collections: 28 | - ibm.ibm_zosmf 29 | tasks: 30 | - name: Identify missing critical updates 31 | include_role: 32 | name: zmf_swmgmt_identify_missing_critical_updates 33 | 34 | ##################################################################################### 35 | # PLAY #3: Identify missing fixcat software updates for the z/OS system's UUID. # 36 | ##################################################################################### 37 | - name: Identify Missing Fixcat Software Updates for the z/OS system's UUID 38 | hosts: swmgmt 39 | gather_facts: false 40 | collections: 41 | - ibm.ibm_zosmf 42 | tasks: 43 | - name: Identify missing fixcat updates 44 | include_role: 45 | name: zmf_swmgmt_identify_missing_fixcat_updates 46 | 47 | ##################################################################################### 48 | # PLAY #4: Search the the z/OS system's UUID for software updates. # 49 | ##################################################################################### 50 | - name: Search the z/OS system's UUID for Software Updates 51 | hosts: swmgmt 52 | gather_facts: false 53 | collections: 54 | - ibm.ibm_zosmf 55 | tasks: 56 | - name: Search software updates 57 | include_role: 58 | name: zmf_swmgmt_search_software_updates 59 | -------------------------------------------------------------------------------- /tests/CICD/playbooks/workflow_complete_CICDtest1.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | # This sample playbook demonstrates using role `zmf_workflow_complete` to complete a z/OS workflow. 4 | # Example: 5 | # ansible-playbook -i hosts sample_role_workflow_complete.yml 6 | 7 | - name: sample of completing a z/OS workflow 8 | hosts: workflow 9 | gather_facts: no 10 | collections: 11 | - ibm.ibm_zosmf 12 | tasks: 13 | - include_role: 14 | name: zmf_workflow_complete 15 | vars: 16 | workflow_name: "ansible CICDtest_{{ inventory_hostname }}" # The name of the workflow 17 | workflow_file: "/global/zosmf/IZUDFLT0/data/workflow_sample_automation_steps.xml" # The location of the workflow definition file 18 | # force_complete: False # Whether to complete the workflow instance forcibly or idempotently. Default is False 19 | # complete_check_times: 10 # The maximum number of time that is used for periodic checks of the workflow status, Default is 10 20 | # complete_check_delay: 5 # The interval time between periodic checks of the workflow status. Default is 5 21 | - ansible.builtin.debug: var=result 22 | -------------------------------------------------------------------------------- /tests/CICD/playbooks/zmsc_run_mgmt_service_CICDTest1.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) IBM Corporation 2021 2 | 3 | # This sample playbook demonstrates using roles `zmf_zmsc_run_management_service` to run 4 | # a sample management service published in z/OS Management Service Catalog 5 | # Example: 6 | # ansible-playbook -i hosts zmsc_run_mgmt_service_CICDTest1.yml 7 | 8 | - name: Test zmf_zmsc_run_management_service role 9 | hosts: cpm1 10 | gather_facts: no 11 | collections: 12 | - ibm.ibm_zosmf 13 | vars: 14 | - name: instance_info_json_path #will store instance json information globally thru the playbook 15 | tasks: 16 | - include_role: 17 | name: zmf_zmsc_run_management_service 18 | vars: 19 | system_name: "P01" 20 | catalog_service_name: "List attributes of a RACF user ID" 21 | category_name: "Sample services" 22 | # change_record_number: "123" 23 | # job_statement: "//HIRENA JOB (ACCTINFO),CLASS=A,MSGCLASS=0" 24 | input_vars: '{"userID":"HIREN"}' -------------------------------------------------------------------------------- /tests/sanity/ignore-2.10.txt: -------------------------------------------------------------------------------- 1 | plugins/modules/zmf_authenticate.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 2 | plugins/modules/zmf_workflow.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 3 | plugins/modules/zmf_workflow.py validate-modules:no-log-needed # Ignore no-log-needed check for workflow_key 4 | plugins/modules/zmf_sca.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 -------------------------------------------------------------------------------- /tests/sanity/ignore-2.11.txt: -------------------------------------------------------------------------------- 1 | plugins/modules/zmf_authenticate.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 2 | plugins/modules/zmf_workflow.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 3 | plugins/modules/zmf_workflow.py validate-modules:no-log-needed # Ignore no-log-needed check for workflow_key 4 | plugins/modules/zmf_sca.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 -------------------------------------------------------------------------------- /tests/sanity/ignore-2.12.txt: -------------------------------------------------------------------------------- 1 | plugins/modules/zmf_authenticate.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 2 | plugins/modules/zmf_workflow.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 3 | plugins/modules/zmf_workflow.py validate-modules:no-log-needed # Ignore no-log-needed check for workflow_key 4 | plugins/modules/zmf_sca.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 -------------------------------------------------------------------------------- /tests/sanity/ignore-2.13.txt: -------------------------------------------------------------------------------- 1 | plugins/modules/zmf_authenticate.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 2 | plugins/modules/zmf_workflow.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 3 | plugins/modules/zmf_workflow.py validate-modules:no-log-needed # Ignore no-log-needed check for workflow_key 4 | plugins/modules/zmf_sca.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 -------------------------------------------------------------------------------- /tests/sanity/ignore-2.14.txt: -------------------------------------------------------------------------------- 1 | plugins/modules/zmf_authenticate.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 2 | plugins/modules/zmf_workflow.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 3 | plugins/modules/zmf_workflow.py validate-modules:no-log-needed # Ignore no-log-needed check for workflow_key 4 | plugins/modules/zmf_sca.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 -------------------------------------------------------------------------------- /tests/sanity/ignore-2.15.txt: -------------------------------------------------------------------------------- 1 | plugins/modules/zmf_authenticate.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 2 | plugins/modules/zmf_workflow.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 3 | plugins/modules/zmf_workflow.py validate-modules:no-log-needed # Ignore no-log-needed check for workflow_key 4 | plugins/modules/zmf_sca.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 -------------------------------------------------------------------------------- /tests/sanity/ignore-2.16.txt: -------------------------------------------------------------------------------- 1 | plugins/modules/zmf_authenticate.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 2 | plugins/modules/zmf_workflow.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 3 | plugins/modules/zmf_workflow.py validate-modules:no-log-needed # Ignore no-log-needed check for workflow_key 4 | plugins/modules/zmf_sca.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 -------------------------------------------------------------------------------- /tests/sanity/ignore-2.9.txt: -------------------------------------------------------------------------------- 1 | plugins/modules/zmf_authenticate.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 2 | plugins/modules/zmf_workflow.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 3 | plugins/modules/zmf_workflow.py validate-modules:no-log-needed # Ignore no-log-needed check for workflow_key 4 | plugins/modules/zmf_sca.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0 --------------------------------------------------------------------------------