ibm / ibm.ibm_zos_zosmf / 2.5.0 / module / zmf_workflow Operate z/OS workflows | "added in version" 2.9 of ibm.ibm_zos_zosmf" Authors: Yang Cao (@zosmf-Young), Yun Juan Yang (@zosmf-Robyn) preview | supported by communityibm.ibm_zos_zosmf.zmf_workflow (2.5.0) — module
Install with ansible-galaxy collection install ibm.ibm_zos_zosmf:==2.5.0
collections: - name: ibm.ibm_zos_zosmf version: 2.5.0
Operate z/OS workflows by issuing z/OSMF workflow RESTful services.
This module supports to compare, start, delete and check a workflow.
- name: Compare whether a workflow with the given name already exists and has the same definition file, variables and properties zmf_workflow: state: "existed" zmf_host: "sample.ibm.com" workflow_name: "ansible_sample_workflow_SY1" workflow_file: "/var/zosmf/workflow_def/workflow_sample_automation_steps.xml" workflow_host: "SY1"
- name: Create a workflow if it does not exist, and start it zmf_workflow: state: "started" zmf_host: "sample.ibm.com" workflow_name: "ansible_sample_workflow_{{ inventory_hostname }}" workflow_file: "/var/zosmf/workflow_def/workflow_sample_automation_steps.xml" workflow_host: "{{ inventory_hostname }}"
- name: Delete a workflow if it exists zmf_workflow: state: "deleted" zmf_host: "sample.ibm.com" workflow_name: "ansible_sample_workflow_SY1"
- name: Check the status of a workflow zmf_workflow: state: "check" zmf_host: "sample.ibm.com" workflow_name: "ansible_sample_workflow_SY1"
state: choices: - existed - started - deleted - check description: - Final state desired for the specified workflow. - 'If I(state=existed), indicate whether a workflow with the given name does not exist, or exists with same or different definition file, variables and properties. ' - 'If I(state=started), create a workflow if it does not exist, and start it. ' - 'If I(state=deleted), delete a workflow if it exists. ' - 'If I(state=check), check the status of a workflow. ' required: true type: str zmf_crt: default: null description: - Location of the PEM-formatted certificate chain file to be used for HTTPS client authentication. - If I(zmf_credential) is supplied, I(zmf_crt) is ignored. - If I(zmf_credential) is not supplied, I(zmf_crt) is required when I(zmf_user) and I(zmf_password) are not supplied. required: false type: str zmf_key: default: null description: - Location of the PEM-formatted file with your private key to be used for HTTPS client authentication. - If I(zmf_credential) is supplied, I(zmf_key) is ignored. - If I(zmf_credential) is not supplied, I(zmf_key) is required when I(zmf_user) and I(zmf_password) are not supplied. required: false type: str zmf_host: default: null description: - Hostname of the z/OSMF server. - If I(zmf_credential) is supplied, I(zmf_host) is ignored. - If I(zmf_credential) is not supplied, I(zmf_host) is required. required: false type: str zmf_port: default: null description: - Port number of the z/OSMF server. - If I(zmf_credential) is supplied, I(zmf_port) is ignored. required: false type: int zmf_user: default: null description: - User name to be used for authenticating with z/OSMF server. - If I(zmf_credential) is supplied, I(zmf_user) is ignored. - If I(zmf_credential) is not supplied, I(zmf_user) is required when I(zmf_crt) and I(zmf_key) are not supplied. - If I(zmf_credential) is not supplied and I(zmf_crt) and I(zmf_key) are supplied, I(zmf_user) and I(zmf_password) are ignored. required: false type: str workflow_key: default: null description: - Generated key to uniquely identify the workflow instance. - Either I(workflow_name) or I(workflow_key) is required when I(state=started/deleted/check). required: false type: str zmf_password: default: null description: - Password to be used for authenticating with z/OSMF server. - If I(zmf_credential) is supplied, I(zmf_password) is ignored. - If I(zmf_credential) is not supplied, I(zmf_password) is required when I(zmf_crt) and I(zmf_key) are not supplied. - If I(zmf_credential) is not supplied and I(zmf_crt) and I(zmf_key) are supplied, I(zmf_user) and I(zmf_password) are ignored. required: false type: str workflow_file: default: null description: - Location of the workflow definition file. required: false type: str workflow_host: default: null description: - Nickname of the target z/OS system on which the workflow is to be performed. - This variable should be specified as C({{ inventory_hostname }}), and its value should be specified in the inventory file as a managed node. required: false type: str workflow_name: default: null description: - Descriptive name of the workflow. - It is recommended that you use the naming rule C(ansible_workflowName_{{ workflow_host }}) when I(state=started). - Required when I(state=existed). - Either I(workflow_name) or I(workflow_key) is required when I(state=started/deleted/check). required: false type: str workflow_vars: default: null description: - Values of one or more workflow variables in JSON format. - For example, C({"user_to_list":"DEBUG1", "tsocmd_to_issue":"TIME"}) required: false type: dict workflow_owner: default: null description: - User name of the workflow owner. - If this value is omitted, I(zmf_user) is used as workflow owner. required: false type: str zmf_credential: default: null description: - Authentication credentials, returned by module C(zmf_authenticate), for the successful authentication with z/OSMF server. - If I(zmf_credential) is supplied, I(zmf_host), I(zmf_port), I(zmf_user), I(zmf_password), I(zmf_crt) and I(zmf_key) are ignored. required: false suboptions: LtpaToken2: default: null description: - The value of Lightweight Third Party Access (LTPA) token, which supports strong encryption. - If I(jwtToken) is not supplied, I(LtpaToken2) is required. required: false type: str jwtToken: default: null description: - The value of JSON Web token, which supports strong encryption. - If I(LtpaToken2) is not supplied, I(jwtToken) is required. required: false type: str zmf_host: description: Hostname of the z/OSMF server. required: true type: str zmf_port: default: null description: Port number of the z/OSMF server. required: false type: int type: dict workflow_vendor: default: null description: - Name of the vendor that provided the workflow definition file. required: false type: str workflow_category: choices: - general - configuration default: null description: - Category for the workflow. required: false type: str workflow_comments: default: null description: - User-specified information to be associated with the workflow at creation time. required: false type: str workflow_step_name: default: null description: - Name of the workflow step at which automation processing is to begin when the workflow is started. required: false type: str workflow_vars_file: default: null description: - Location of the optional properties file to be used to pre-specify the values of one or more variables that are defined in workflow definition file. required: false type: str workflow_access_type: choices: - Public - Restricted - Private default: Public description: - Access type for the workflow when the workflow is created. required: false type: str workflow_file_system: default: null description: - Nickname of the system on which the specified workflow definition file and any related files reside. required: false type: str workflow_account_info: default: null description: - For a workflow that submits a batch job, this variable specifies the account information for the JCL JOB statement. required: false type: str workflow_job_statement: default: null description: - For a workflow that submits a batch job, this variable specifies the JOB statement JCL for the job. required: false type: str workflow_assign_to_owner: default: true description: - Specifies whether the workflow steps are assigned to the workflow owner when the workflow is created. required: false type: bool workflow_notification_url: default: null description: - URL to be used for notification when the workflow is started. required: false type: str workflow_perform_subsequent: default: true description: - Specifies whether the subsequent automated steps are performed when the workflow is started. required: false type: bool workflow_delete_completed_jobs: default: false description: - For a workflow that submits a batch job, this variable specifies whether the job is deleted from the JES spool after it completes. required: false type: bool workflow_resolve_conflict_by_using: choices: - outputFileValue - existingValue - leaveConflict default: outputFileValue description: - Specifies how to handle variable conflicts if any are detected at workflow creation time. - Such conflicts can be found when z/OSMF Workflows task reads the output file from a step that runs a REXX exec or UNIX shell script. required: false type: str workflow_resolve_global_conflict_by_using: choices: - global - input default: global description: - Version of the variable to be used if the supplied workflow variable conflicts with an existing global variable in z/OSMF Workflows task. required: false type: str
changed: description: - Indicates if any change is made during the module operation. - If `state=existed/check`, always return false. - If `state=started` and the workflow is started, return true. - If `state=deleted` and the workflow is deleted, return true. returned: always type: bool completed: description: Indicate whether the workflow is completed. returned: on success when `state=existed/check` type: bool deleted: description: Indicate whether the workflow is deleted. returned: on success when `state=deleted` type: bool message: description: - The output message generated by the module. - If `state=existed`, indicate whether a workflow with the given name does not exist, or exists with same or different definition file, variables and properties. - If `state=started`, indicate whether the workflow is started. - If `state=deleted`, indicate whether the workflow to be deleted does not exist or is deleted. - If `state=check`, indicate whether the workflow is completed, is not completed, or is still in progress. returned: on success sample: sample1: 'Workflow instance named: ansible_sample_workflow_SY1 with same definition file, variables and properties is found.' sample2: 'Workflow instance named: ansible_sample_workflow_SY1 with different definition file is found.' sample3: 'Workflow instance named: ansible_sample_workflow_SY1 is started, you can use state=check to check its final status.' sample4: 'Workflow instance named: ansible_sample_workflow_SY1 is still in progress.' sample5: 'Workflow instance named: ansible_sample_workflow_SY1 is completed' sample6: 'Workflow instance named: ansible_sample_workflow_SY1 is deleted.' sample7: 'Workflow instance named: ansible_sample_workflow_SY1 does not exist.' type: str same_workflow_instance: description: Indicate whether the existing workflow has the same or different definition file, variables and properties. returned: on success when `state=existed` type: bool waiting: description: Indicate whether it needs to wait and check again because the workflow is still in progress. returned: on success when `state=check` type: bool workflow_key: description: Generated key to uniquely identify the existing or started workflow. returned: on success when `state=existed/started` sample: 2535b19e-a8c3-4a52-9d77-e30bb920f912 type: str