community.routeros.command – Run commands on remote devices running MikroTik RouterOS¶
This plugin is part of the community.routeros collection (version 1.2.0).
To install it use:
ansible-galaxy collection install community.routeros.
To use it in a playbook, specify:
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.
- 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 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 contains x86 - result contains ether1
Common return values are documented here, the following are the fields unique to this module: