Im on routeros 6.43 and ansible 2.7 and trying the ansible modules: raw, command and the new routeros_command https://docs.ansible.com/ansible/latest ... odule.html. None succeeeds, and they just hang. Full debug shows its just hangs on this command:
Code: Select all
<172.16.179.1> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/olof/.ansible/cp/5edf2db020 -tt 172.16.179.1 '/ip address print'
Some examples:
Code: Select all
ansible mikrotik -m command -a "executable= /ip address print"
[WARNING]: sftp transfer mechanism failed on [172.16.179.1]. Use ANSIBLE_DEBUG=1 to see detailed information
[WARNING]: scp transfer mechanism failed on [172.16.179.1]. Use ANSIBLE_DEBUG=1 to see detailed information
raw module...
Code: Select all
ansible mikrotik -m raw -a "/ip address print"
Code: Select all
playbook.yml
- hosts: mikrotik
gather_facts: no
tasks:
- name: Display resource statistics (routeros)
raw:
commands: /system routerboard print
# wait_for: result[0] contains MikroTik
# register: routeros_resources
normal SSH works fine with no magic needed.
Code: Select all
ssh 172.16.179.1 "ip addr pri"
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK INTERFACE
0 172.24.31.242/29 172.24.31.240 ether1
...