cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
640
Views
0
Helpful
2
Replies

Cisco Switch CBS350 connect to ansible

ThummalaSharan
Level 1
Level 1

Hi Team, 

I am Trying to connect the cisco switch to ansible getting below error

[cb350]
cb350 anisble_host=10.2.200.49 ansible_connection=network_cli ansible_network_os=ios ansible_user=cisco ansible_pass=XXXXX@XXXX
qcold ansible_host=10.2.3.6 ansible_connection=network_cli ansible_network_os=ios ansible_ssh_user=cisco ansible_ssh_pass=XYYYYY*RRR

 


PLAY [ping cisco switch] ****************************************************************************************************************

TASK [Test reachability to 10.2.200.49 using default vrf] ****************************************************************************
fatal: [cb350]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "[Errno -2] Name or service not known"}
fatal: [qcold]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "Failed to authenticate: Authentication failed."}

PLAY RECAP ******************************************************************************************************************************
cb350 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
qcold : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

 

Cat ping2.yml

---
- name: ping cisco switch
hosts: all
remote_user: cisco
gather_facts: false
tasks:
- name: Test reachability to 10.2.200.49 using default vrf
ios_ping:
dest: 10.2.200.49

2 Replies 2

pieterh
VIP
VIP

what happens if you manually ssh into the device from the same computer with user cisco and password
if this is successful, ansible may not like this password containg the  "@"character 
(it sends the password without "@") -> check by changing the password 

balaji.bandi
Hall of Fame
Hall of Fame

i would focus on

"msg": "Failed to authenticate: Authentication failed."}

as asked do the authenticaiton works normally with putty SSH connection ?

what logs you see when the ansible connection intiated time on switch ?

below guide help you :

https://github.com/ansible-collections/community.ciscosmb/blob/main/README.md

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Review Cisco Networking for a $25 gift card