I’m new to Ansible and trying to write my first playbook.
But i keep getting an error: fatal: [RTR1]: FAILED! => {“changed”: false, “msg”: “Connection type ssh is not valid for this module”}
I’m suspecting Ansible is complaining about my Cisco devices ssh settings (running diffie-hellman-group1-sha1) but I’m not sure if that’s correct. Will appreciate your assistance
You need to use ansible_connection=network_cli. This connection plugin provides a connection to remote devices over the SSH and implements a CLI shell. It is typically used by network devices for sending CLI commands to network devices and also receiving information from them. If your devices are running Cisco IOS, please have a look at the platform guide.
Thanks for the input. I did try what you suggested but I’m here the same issue. Please take a look at the screenshot and let me know if you see something
I see that the group name in inventory is “Cisco_Router”, however, the group_vars file is named as “ios.yaml”. Those two should be identical in this approach.
Your group_vars yml file should be named identical to the group-name you put your device(s). This is why the variables are not being called. If you define these in your playbook it would work and that can help later isolate where things are not working.
Thank you everyone for your help on this. This issue has been resolved. As you previously mentioned, I made sure the group_vars yml file was named identical with the group-name i have my devices