Hi. I have the same problem with Ansible 2.16.2 installed via PIP in venv.
Using the same config/inventory/playbook I have no problems when using Ansible 2.9.6 installed on Ubuntu 20.04 with Python 3.8
This is my cfg file:
[defaults]
inventory = ./inventory
host_key_checking = False
retry_files_enabled = False
gathering = explicit
action_warnings = False
library =
[persistent_connection]
command_timeout = 200
connect_timeout = 200
connect_retry_timeout = 100
This is my inventory file
[all]
[all:children]
ios
nxos
[all:vars]
ansible_user=alexd
ansible_password=S00perP@ss!
ansible_connection = ansible.netcommon.network_cli
This is needed for IOS, IOS-XE, NXOS
connect_timeout = 200
command_timeout = 200
#connection = paramiko
[ios]
[ios:children]
routers
switches
[ios:vars]
ansible_network_os=cisco.ios.ios
ansible_become=yes
ansible_become_method=enable
ansible_become_password=Enable
[routers]
R1 ansible_host=192.168.122.10
R2 ansible_host=192.168.122.12
And this is the playbook:
- name: “PLAY 1: Gather Data from network devices”
hosts: R2
connection: paramiko
collections:
- cisco.ios
gather_facts: false
become: true
become_method: enable
tasks:
The ansible ping Work perfectly with both routers.
(venv) ubuntu@ubuntu:~/DevAuto/AnsibleTest2$ ansible -m ping routers
[WARNING]: ansible-pylibssh not installed, falling back to paramiko
R2 | SUCCESS => {
“changed”: false,
“ping”: “pong”
}
R1 | SUCCESS => {
“changed”: false,
“ping”: “pong”
}
However playbook fails with “Authentication failed” message
(venv) ubuntu@ubuntu:~/DevAuto/AnsibleTest2$ ansible-playbook get_info_ios.yml
PLAY [PLAY 1: Gather Data from network devices] **********************************************************************************************************************************************
TASK [TASK 1: IOS >> Show version] ***********************************************************************************************************************************************************
[WARNING]: ansible-pylibssh not installed, falling back to paramiko
fatal: [R2]: FAILED! => {“changed”: false, “msg”: “Failed to authenticate: Authentication failed: transport shut down or saw EOF”}
PLAY RECAP ***********************************************************************************************************************************************************************************
R2 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Need help!