ibm_zos_core
ibm_zos_core copied to clipboard
[Bug] [zos_script] Module does not support multiple command line args
Is there an existing issue for this?
- [X] There are no existing issues.
Bug description
The module has a feature which allows for args to be submitted in-line which currently does not read/parse more than the FIRST arg.
- name: Run REXX script to get a job's information.
ibm.ibm_zos_core.zos_script:
cmd: "{{ playbook_dir }}/files/JOB_INFO JOBID=JOB00114 OWNER=OMVSADM JOBNAME=HELLO"
remote_src: false
However, the 2nd and 3rd args (OWNER and JOBNAME) are not successfully parsed, see partial extracts of the verbosity output:
changed: [zos_host] => {
"changed": true,
"cmd": "/Users/ketan/dev/z_ansible_collections_samples/zos_concepts/zos_script/files/JOB_INFO JOBID=JOB00114 OWNER=OMVSADM JOBNAME=HELLO",
"invocation": {
"module_args": {
"chdir": null,
"cmd": "/.ansible/tmp/zos_script.mipsomgr.JOB_INFO JOBID=JOB00114", <------- missing OWNER/JOBNAME
"creates": null,
"executable": null,
"remote_src": false,
"removes": null,
"template_parameters": null,
"use_template": false
}
},
"rc": 0,
"remote_cmd": "/.ansible/tmp/zos_script.mipsomgr.JOB_INFO JOBID=JOB00114", <------- missing OWNER/JOBNAME
"stderr": "",
Notice the discrepancy between cmd
outside the invocation
dict and cmd
and remote_cmd
inside the invocation
dict, the two value inside the invocation
dict are missing the OWNER and JOBNAME args which were passed in from the playbook.
IBM z/OS Ansible core Version
v1.10.0
IBM Z Open Automation Utilities
v1.3.2
IBM Enterprise Python
v3.11.x (default)
ansible-version
v2.16.x (default)
z/OS version
v2.5 (default)
Ansible module
zos_script
Playbook verbosity output.
The above was recreated from running the sample playbook on the samples repo
First I submitted a job,
- vim hello.jcl
- copy/paste contents of HELLO.JCL
- Use USS command
submit hello.jcl
to submit the jcl, job number gets printed to command line,-
# submit hello.jcl JOB JOB00114 submitted from path 'hello.jcl'
-
- then use
jls | grep <job_number>
to get the remaining job details (owner is OMVSADM, jobname is HELLO)-
# jls | grep 'JOB00114' OMVSADM HELLO JOB00114 CC 0000
-
Then I ran the first task in the sample playbook and substitute in the values for JOBID, OWNER, and JOBNAME
Expected output from the recreate is:
changed: [zos_host] => {
"changed": true,
"cmd": "/Users/ketan/dev/z_ansible_collections_samples/zos_concepts/zos_script/files/JOB_INFO JOBID=JOB00114 OWNER=OMVSADM JOBNAME=HELLO",
"invocation": {
"module_args": {
"chdir": null,
"cmd": "/.ansible/tmp/zos_script.mipsomgr.JOB_INFO JOBID=JOB00114",
"creates": null,
"executable": null,
"remote_src": false,
"removes": null,
"template_parameters": null,
"use_template": false
}
},
"rc": 0,
"remote_cmd": "/.ansible/tmp/zos_script.mipsomgr.JOB_INFO JOBID=JOB00114",
"stderr": "",
"stderr_lines": [
""
],
"stdout": "-----START OF JOB-----\nposition:1\njob_id:JOB00114..JOBID.1\njob_name:HELLO\nsubsystem:STL1\nsystem:\nowner:OMVSADM\nret_code_msg:CC 0000\nclass:A\ncontent_type:JOB\n-----END OF JOB-----\n",
"stdout_lines": [
"-----START OF JOB-----",
"position:1",
"job_id:JOB00114..JOBID.1",
"job_name:HELLO",
"subsystem:STL1",
"system:",
"owner:OMVSADM",
"ret_code_msg:CC 0000",
"class:A",
"content_type:JOB",
"-----END OF JOB-----",
""
],
"tempfile_path": "/.ansible/tmp/zos_script.mipsomgr.JOB_INFO"
}
Ansible configuration.
No response
Contents of the inventory
No response
Contents of group_vars
or host_vars
No response