PARALLAX

command

Run commands and wait for conditions on Cisco SMB switches

Collection: community.ciscosmb

Full Name: community.ciscosmb.command

Controller module — runs on the local controller, not on remote hosts.

Synopsis

Run commands and wait for conditions on Cisco SMB switches

Parameters

NameTypeRequiredDefaultDescription
commandslistyesOrdered CLI command strings
wait_forlistConditions evaluated against command results
matchstringallRequire all or any condition
retriesint10Number of condition evaluation attempts
intervalint1Seconds between unsuccessful attempts

Example

yaml
- name: Run command on remote devices
  community.ciscosmb.command:
    commands: show version

- name: Run command and check to see if output contains PID
  community.ciscosmb.command:
    commands: show inventory
    wait_for: result[0] contains PID

- name: Run multiple commands on remote nodes
  community.ciscosmb.command:
    commands:
        - show version
        - show system

- name: Run multiple commands and evaluate the output
  community.ciscosmb.command:
    commands:
        - show version
        - show system
    wait_for:
        - result[0] contains Active-image
        - result[1] contains "System Up Time"
Search
    ↑ ↓ move↵ openesc close