haught.network.edgeswitch_command (1.0.0) — module

Run one or more commands on EdgeSwitch devices

Authors: Matt Haught (@haught), Chad Norgan (@beardymcbeards), Sam Doran (@samdoran)

Install collection

Install with ansible-galaxy collection install haught.network:==1.0.0


Add to requirements.yml

  collections:
    - name: haught.network
      version: 1.0.0

Description

This command module allows running one or more commands on a remote device running EdgeSwitch, such as the Ubiquiti EdgePoint S16.

This module does not support running commands in configuration mode.

Certain C(show) commands in EdgeSwitch produce many lines of output and use a custom pager that can cause this module to hang. If the value of the environment variable C(ANSIBLE_EDGESWITCH_TERMINAL_LENGTH) is not set, the default number of 10000 is used.

This is a network module and requires C(connection: network_cli) in order to work properly.

For more information please see the L(Network Guide,../network/getting_started/index.html).

Inputs

    
match:
    choices:
    - any
    - all
    default: all
    description:
    - Used in conjunction with C(wait_for) to create match policy. If set to C(all), then
      all conditions in C(wait_for) must be met. If set to C(any), then only one condition
      must match.
    required: false
    type: str

retries:
    default: 10
    description:
    - Number of times a command should be tried before it is considered failed. The command
      is run on the target device and evaluated against the C(wait_for) conditionals.
    required: false
    type: int

commands:
    description:
    - The commands or ordered set of commands that should be run against the remote device.
      The output of the command is returned to the playbook. If the C(wait_for) argument
      is provided, the module is not returned until the condition is met or the number
      of retries is exceeded.
    elements: str
    required: true
    type: list

interval:
    default: 1
    description:
    - The number of seconds to wait between C(retries) of the command.
    required: false
    type: int

wait_for:
    description:
    - Causes the task to wait for a specific condition to be met before moving forward.
      If the condition is not met before the specified number of retries is exceeded,
      the task will fail.
    elements: str
    required: false
    type: list

Outputs

stdout:
  description: The set of responses from the commands
  returned: always apart from low level errors (such as action plugin)
  sample:
  - '...'
  - '...'
  type: list
stdout_lines:
  description: The value of stdout split into a list
  returned: always
  sample:
  - - '...'
    - '...'
  - - '...'
  - - '...'
  type: list