.. _ansible.netcommon.cli_command_module:
*****************************
ansible.netcommon.cli_command
*****************************
**Run a cli command on cli-based network devices**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- Sends a command to a network device and returns the result read from the device.
Parameters
----------
.. raw:: html
| Parameter |
Choices/Defaults |
Comments |
|
answer
list
/ elements=string
|
|
The answer to reply with if prompt is matched. The value can be a single answer or a list of answer for multiple prompts. In case the command execution results in multiple prompts the sequence of the prompt and excepted answer should be in same order.
|
|
check_all
boolean
|
|
By default if any one of the prompts mentioned in prompt option is matched it won't check for other prompts. This boolean flag, that when set to True will check for all the prompts mentioned in prompt option in the given order. If the option is set to True all the prompts should be received from remote host if not it will result in timeout.
|
|
command
string
/ required
|
|
The command to send to the remote network device. The resulting output from the command is returned, unless sendonly is set.
|
|
newline
boolean
|
|
The boolean value, that when set to false will send answer to the device without a trailing newline.
|
|
prompt
list
/ elements=string
|
|
A single regex pattern or a sequence of patterns to evaluate the expected prompt from command.
|
|
sendonly
boolean
|
|
The boolean value, that when set to true will send command to the device but not wait for a result.
|