I am trying to use ansible to send commands to some Mikrotik routers (running RouterOS 6.44.2). However, I am unable to connect - the routers log a cryptic “expected msg: 50 got: 5”, and the SSH session is closed.
It appears that even though I configured Ansible with a username/password combination, it tries public-key authentication first, and does not/can not fallback to user/password when this fails.
I have also posted an issue with Ansible - if you are interested in the details of my configuration, you can find all of them here: https://github.com/ansible/ansible/issues/55042
I have already tried changing “pty=False” and “look_for_keys=False” under [paramiko_connection] in the Ansible configuration, but it still tries keys first.
If I enable key-based authentication on the router, I can connect to it and send commands using the raw module ( ansible -c paramiko -u bogd -k -m raw ), but routeros_command hangs on connection.
If anyone was able to get the routeros_command module to work, could you please tell me what your ansible configuration looks like?
Thank you!