ibm.ibm_zos_core.zos_operator (1.3.6) — module

Execute operator command

| "added in version" 1.1.0 of ibm.ibm_zos_core"

Authors: Ping Xiao (@xiaopingBJ)

Install collection

Install with ansible-galaxy collection install ibm.ibm_zos_core:==1.3.6


Add to requirements.yml

  collections:
    - name: ibm.ibm_zos_core
      version: 1.3.6

Description

Execute an operator command and receive the output.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Execute an operator command to show active jobs
  zos_operator:
    cmd: 'd u,all'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Execute an operator command to show active jobs with verbose information
  zos_operator:
    cmd: 'd u,all'
    verbose: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Execute an operator command to purge all job logs (requires escaping)
  zos_operator:
    cmd: "\\$PJ(*)"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Execute operator command to show jobs, waiting UP TO 5 seconds for response
  zos_operator:
    cmd: 'd u,all'
    wait_time_s: 5
    wait: false
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Execute operator command to show jobs, always waiting 7 seconds for response
  zos_operator:
    cmd: 'd u,all'
    wait_time_s: 7
    wait: true

Inputs

    
cmd:
    description:
    - The command to execute.
    required: true
    type: str

wait:
    default: true
    description:
    - Specify to wait the full I(wait_time_s) interval before retrieving responses.
    - This option is recommended to ensure the responses are accessible and captured by
      logging facilities and the I(verbose) option.
    - I(delay=True) waits the full I(wait_time_s) interval.
    - I(delay=False) returns as soon as the first command executes.
    required: false
    type: bool

verbose:
    default: false
    description:
    - Return diagnostic messages that lists and describes the execution of the operator
      commands.
    - Return security trace messages that help you understand and diagnose the execution
      of the operator commands
    - Return trace instructions displaying how the the command's operation is read, evaluated
      and executed.
    required: false
    type: bool

wait_time_s:
    default: 0
    description:
    - Set maximum time in seconds to wait for the commands to execute.
    - When set to 0, the system default is used.
    - This option is helpful on a busy system needing more time to execute commands.
    - Setting I(wait) can instruct if execution should wait the full I(wait_time_s).
    required: false
    type: int

Outputs

changed:
  description: Indicates if any changes were made during module operation. Given operator
    commands may introduce changes that are unknown to the module. True is always
    returned unless either a module or command failure has occurred.
  returned: always
  sample: true
  type: bool
content:
  description: The text from the command issued, plus verbose messages if I(verbose=True)
  returned: on success
  sample:
  - 'MV2C      2020039  04:29:57.58             ISF031I CONSOLE XIAOPIN ACTIVATED '
  - 'MV2C      2020039  04:29:57.58            -D U,ALL                           '
  - 'MV2C      2020039  04:29:57.59             IEE457I 04.29.57 UNIT STATUS 948  '
  - '         UNIT TYPE STATUS        VOLSER     VOLSTATE      SS                 '
  - '          0100 3277 OFFLINE                                 0                '
  - '          0101 3277 OFFLINE                                 0                '
  - ISF050I USER=OMVSADM GROUP= PROC=REXX TERMINAL=09A3233B
  - ISF051I SAF Access allowed SAFRC=0 ACCESS=READ CLASS=SDSF RESOURCE=GROUP.ISFSPROG.SDSF
  - ISF051I SAF Access allowed SAFRC=0 ACCESS=READ CLASS=SDSF RESOURCE=ISFCMD.FILTER.PREFIX
  - ISF055I ACTION=D Access allowed USERLEVEL=7 REQLEVEL=1
  - ISF051I SAF Access allowed SAFRC=0 ACCESS=READ CLASS=SDSF RESOURCE=ISFCMD.ODSP.ULOG.JES2
  - ISF147I REXX variable ISFTIMEOUT fetched, return code 00000001 value is ''.
  - ISF754I Command 'SET DELAY 5' generated from associated variable ISFDELAY.
  - 'ISF769I System command issued, command text: D U,ALL -S.'
  - ISF146I REXX variable ISFDIAG set, return code 00000001 value is '00000000 00000000
    00000000 00000000 00000000'.
  - 'ISF766I Request completed, status: COMMAND ISSUED.'
  type: list
rc:
  description: Return code of the operator command
  returned: always
  sample: 0
  type: int