Warning: This document is for an old version of IBM z/OSMF Collection. The latest version is v3.0.0.

sample_role_job_queryΒΆ

For configuration and setup, see Playbook Documentation.

This sample playbook shows how to query a job running on the target z/OS systems via z/OSMF.

- name: sample of querying a job running on z/OS and check its return code
  hosts: job
  gather_facts: no
  collections:
    - ibm.ibm_zos_zosmf
  vars_prompt:
    - name: zmf_user
      prompt: "Enter your zOSMF username (skip if zmf_crt and zmf_key are supplied)"
      private: no
    - name: zmf_password
      prompt: "Enter your zOSMF password (skip if zmf_crt and zmf_key are supplied)"
      private: yes
  tasks:
    - include_role:
        name: zmf_job_query
      vars:
        job_name: "JCLSAMP1" # The name of the job for which status is requested
        job_id: "JOB00000" # The ID of the job for which status is requested
        # job_max_rc: 0 # The maximum return code for the job that should be allowed without failing the role. Default is 0
        # complete_check_times: 10 # The maximum number of time that is used for periodic checks of the job status. Default is 10
        # complete_check_delay: 5 # The interval time between periodic checks of the job status. Default is 5

Note

To run the sample playbook, the inventory file hosts needs to be updated to identify the target z/OSMF end points.

For more details about role variables, see zmf_job_query.