community.network.routeros_command – Run commands on remote devices running MikroTik RouterOS¶
Note
This plugin is part of the community.network collection (version 1.3.2).
To install it use: ansible-galaxy collection install community.network
.
To use it in a playbook, specify: community.network.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¶
tasks:
- name: Run command on remote devices
community.network.routeros_command:
commands: /system routerboard print
- name: Run command and check to see if output contains routeros
community.network.routeros_command:
commands: /system resource print
wait_for: result[0] contains MikroTik
- name: Run multiple commands on remote nodes
community.network.routeros_command:
commands:
- /system routerboard print
- /system identity print
- name: Run multiple commands and evaluate the output
community.network.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)