community.routeros.command – Run commands on remote devices running MikroTik RouterOS¶
Note
This plugin is part of the community.routeros collection (version 1.1.0).
To install it use: ansible-galaxy collection install community.routeros
.
To use it in a playbook, specify: community.routeros.command
.
Synopsis¶
Sends arbitrary commands to an RouterOS node and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
Parameters¶
Examples¶
- name: Run command on remote devices
community.routeros.command:
commands: /system routerboard print
- name: Run command and check to see if output contains routeros
community.routeros.command:
commands: /system resource print
wait_for: result[0] contains MikroTik
- name: Run multiple commands on remote nodes
community.routeros.command:
commands:
- /system routerboard print
- /system identity print
- name: Run multiple commands and evaluate the output
community.routeros.command:
commands:
- /system routerboard print
- /interface ethernet print
wait_for:
- result[0] contains x86
- result[1] contains ether1
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Egor Zaitsev (@heuels)