Can't connect to Cisco router using network_cli but ssh from raw module works fine

Looks like the ssh type starts out as auto and then gets set to libssh. As I recall, in order to use the cisco.iosxr.iosxr, I was forced to switch to network_cli, but in order to get that work, I had to install ansible-pylibssh as well as libssh itself using Homebrew.

I added set it to use paramiko in my ansible.cfg file. I didn’t get a crypto error this time. Now I’m getting this:

"msg": "No existing session"

I did a search for “ansible cisco no existing session” and see that it has been a common problem for years and I don’t see a solution yet, although there must be one somewhere.


EDIT: It looks like this might be a paramiko problem, not an Ansible problem. I see some people running into this when using paramiko in Python to connect to network devices. For example:

I’m not sure what the solution is, though. Maybe I just need to switch back to libssh and then figure out the crypto algo problem. If I can set which crypto algos to use in Ansible, I think that would solve it.