1+ # Copyright (c) IBM Corporation 2025
2+
3+
4+ DOCUMENTATION = r"""
5+ role: job_status
6+ short_description: Role that query, extract job status and if is running.
7+ description:
8+ - >
9+ The B(IBM z/ibm_zos_core collection) provides an Ansible role, referred to as
10+ B(job_status), to query a particular job with a given job_id and parse the response
11+ to return as a msg the job status and if the job is currently running or not.
12+ author:
13+ - Marcel Gutierrez (@AndreMarcel99)
14+ options:
15+ job_id:
16+ description:
17+ - The job id that has been assigned to the job.
18+ - A job id must begin with `STC`, `JOB`, `TSU` and are
19+ followed by up to 5 digits.
20+ - When a job id is greater than 99,999, the job id format will begin
21+ with `S`, `J`, `T` and are followed by 7 digits.
22+ required: True
23+ type: str
24+ notes:
25+ - >
26+ The role tolerate the asterisk (`*`) as wildcard but only retrieve information from
27+ the first job returned that math the patter.
28+ """
29+
30+ EXAMPLES = r"""
31+ - name: Query the job status and if is running of the job STC00001
32+ hosts: sampleHost
33+ gather_facts: no
34+ collections:
35+ - ibm.ibm_zos_core
36+ tasks:
37+ - include_role:
38+ name: job_status
39+ vars:
40+ job_oid: STC00001
41+
42+ """
43+
44+ # Roles don't return anything.
45+ # But RETURN block must be defined for doc extraction tooling to avoid error.
46+ # The content in RETURN block will not be display in doc-site.
47+ RETURN = r"""
48+ changed:
49+ description: Indicates if any change is made during the role operation.
50+ returned: always
51+ type: bool
52+ msg:
53+ description: Two variables that contain the information return by the role.
54+ returned: always
55+ type: dict
56+ contains:
57+ job_active:
58+ description: Boolean value that return if the job is running.
59+ returned: always
60+ type: bool
61+ job_status:
62+ description: Value of the current status of the job.
63+ returned:
64+ type: str
65+ """
0 commit comments