Playbook freezes after several seconds on a task using cisco.ios in Python 3.12

Looks like you have ssh_type set to paramiko, but I’m seeing in the logs there it is trying to use “libssh”.

Are you also specifying ansible_connection=ansible.netcommon.libssh somewhere?

I would think you would want to have consistent settings that all specify the one you prefer to use.

Unfortunately, I don’t have enough experience with running so many forks or with Cisco devices to pin anything down on why newer versions of ansible/libssh/paramiko are slower than the older ones. You might compare it with what’s here:

In general, I’ve found the most significant performance improvements were increasing the socket timeouts for libssh via increasing the ControlPersists value to +600s. This is generally useful for long-running tasks or plays with high host to fork ratios, where the sockets better maintain an authenticated session with all hosts to reduce the overhead when re-authenticating later.