ibm.ibm_zos_core.zos_operator (1.9.0) — module

Execute operator command

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

Authors: Ping Xiao (@xiaopingBJ), Demetrios Dimatos (@ddimatos), Rich Parker (@richp405), Oscar Fernando Flores (@fernandofloresg)

Install collection

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


Add to requirements.yml

  collections:
    - name: ibm.ibm_zos_core
      version: 1.9.0

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 device status and allocation
  zos_operator:
    cmd: 'd u'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Execute an operator command to show device status and allocation with verbose information
  zos_operator:
    cmd: 'd u'
    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, always waiting 5 seconds for response
  zos_operator:
    cmd: 'd a,all'
    wait_time_s: 5
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Display the system symbols and associated substitution texts.
  zos_operator:
    cmd: 'D SYMBOLS'

Inputs

    
cmd:
    description:
    - The command to execute.
    - If the command contains single-quotations, another set of single quotes must be
      added.
    - For example, change the command "...,P='DSN3EPX,-DBC1,S'" to "...,P=''DSN3EPX,-DBC1,S''
      ".
    required: true
    type: str

verbose:
    default: false
    description:
    - Return diagnostic messages that describes the commands execution, options, buffer
      and response size.
    required: false
    type: bool

wait_time_s:
    default: 1
    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 requiring 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
cmd:
  description: Operator command submitted.
  returned: always
  sample: d u,all
  type: str
content:
  description: The resulting text from the command submitted.
  returned: on success
  sample:
  - EC33017A   2022244  16:00:49.00             ISF031I CONSOLE OMVS0000 ACTIVATED
  - 'EC33017A   2022244  16:00:49.00            -D U,ALL '
  - EC33017A   2022244  16:00:49.00             IEE457I 16.00.49 UNIT STATUS 645
  - '                                           UNIT TYPE STATUS        VOLSER     VOLSTATE      SS'
  - '                                           0000 3390 F-NRD                        /RSDNT     0'
  - '                                           0001 3211 OFFLINE                                 0'
  - '                                           0002 3211 OFFLINE                                 0'
  - '                                           0003 3211 OFFLINE                                 0'
  - '                                           0004 3211 OFFLINE                                 0'
  - '                                           0005 3211 OFFLINE                                 0'
  - '                                           0006 3211 OFFLINE                                 0'
  - '                                           0007 3211 OFFLINE                                 0'
  - '                                           0008 3211 OFFLINE                                 0'
  - '                                           0009 3277 OFFLINE                                 0'
  - '                                           000C 2540 A                                       0'
  - '                                           000D 2540 A                                       0'
  - '                                           000E 1403 A                                       0'
  - '                                           000F 1403 A                                       0'
  - '                                           0010 3211 A                                       0'
  - '                                           0011 3211 A                                       0'
  type: list
elapsed:
  description: The number of seconds that elapsed waiting for the command to complete.
  returned: always
  sample: 51.53
  type: float
rc:
  description: Return code for the submitted operator command.
  returned: always
  sample: 0
  type: int
wait_time_s:
  description: The maximum time in seconds to wait for the commands to execute.
  returned: always
  sample: 5
  type: int