cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
651
Views
0
Helpful
1
Replies

Ansible Ping

Jeric
Level 1
Level 1

Is it necessary to distribute the public key to the router/switch in order to use the ansible ping?

I can ssh to the switches using normal ssh but when i use ansible this is the error

ansible all -i inventory -m ping
10.92.38.31 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.92.38.31 port 22: Connection timed out",
"unreachable": true
}
10.92.38.32 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.92.38.32 port 22: Connection timed out",
"unreachable": true
}
192.168.211.1 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.211.1 port 22: Connection timed out",
"unreachable": true
}

1 Reply 1

M02@rt37
VIP
VIP

Hello @Jeric 

Yes, in order to use Ansible with network devices such as routers and switches, it is necessary to distribute the public key to the device. This is because Ansible uses SSH as the transport protocol to communicate with network devices, and SSH uses public key authentication to establish a secure connection between the Ansible control node and the device.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.