Error Connecting to Cisco Switch

Hello Dear Gurus
I am trying to just simply connect to my Cisco switch. I’ve red previous topic about this issue but non of them helped me figure out how to fix this , your help is much appreciated

here is my inventory file

and here is the ping command I use

I am using:

Ansible version 2.9.27
CENTOS 7.9.2009

Python 2.7.5

Thank you in advance

Please provide verbose output using -vvvv

(attachments)


Are you able to connect to the Switch using SSH from the terminal ?

-Ashish

(attachments)


Also provide output of ansible conf file

(attachments)


yes I can do SSH

(attachments)


Sure -vvv

(attachments)


sorry I am new to ansible ,My ansible.cfg file is the default one. I haven’t changed anything in there , do I need to put any entry on this file ?

(attachments)


Hey,
Can you please upgrade to Python 3.8+ and check if you are facing the same issue.

Regards,
Sagar Paul

Can you please try to change the incorrect ansible parameter (absible_user) to ansible_user=cisco and let me know.

Thanks
Ashish

(attachments)


Also "ansbile_network_os" is misspelled

Hey, i can see a mistyping issue (ansible-user=cisco) plz check it

Hi Ashish
Thanks for your reply you are right I’ve corrected that bit is didn’t fix the actual problem :frowning:

(attachments)


Inventory.txt

Playbook: playbook-1.yml

ansible.cfg:

[default]
export ANSIBLE_PARAMIKO_LOOK_FOR_KEYS=false

[paramiko_connection]
look_for_keys=false

[persistant_connection]
command_timeout=60

Command:
Capture2.PNG

Result:

Thanks in advance :slight_smile:

Try renaming inventory.txt file and keep simply “inventory”

(attachments)