# Very first time Network Engineer user - ping module needs to connect with SSH to work?

**URL:** <https://forum.ansible.com/t/very-first-time-network-engineer-user-ping-module-needs-to-connect-with-ssh-to-work/28826>\
**Category:** Ansible Project\
**Created:** [October 19, 2018, 12:49pm UTC](https://forum.ansible.com/t/very-first-time-network-engineer-user-ping-module-needs-to-connect-with-ssh-to-work/28826 "2018-10-19T12:49:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Focaccio](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@Greg\_Focaccio](https://forum.ansible.com/u/Greg_Focaccio)\
**Post date:** [October 19, 2018, 12:49pm UTC](https://forum.ansible.com/t/very-first-time-network-engineer-user-ping-module-needs-to-connect-with-ssh-to-work/28826/1 "2018-10-19T12:49:18Z")

</div>

Hi All,

First time getting into any kind of automation -starting with Ansible.

Odd results for me. What is going on?

Thanks,  
Greg

`05:41root@xfrr3 /etc/ansible ? ansible f1 --module-name=ping`172.16.0.1 | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “Failed to connect to the host via ssh: Permission denied (publickey,password).\r  
\n”,  
“unreachable”: true  
}  
05:41root@xfrr3 /etc/ansible ? ping 172.16.0.1  
PING 172.16.0.1 (172.16.0.1) 56(84) bytes of data.  
64 bytes from 172.16.0.1: icmp\_seq=1 ttl=255 time=0.410 ms  
64 bytes from 172.16.0.1: icmp\_seq=2 ttl=255 time=0.508 ms  
^C  
— 172.16.0.1 ping statistics —  
2 packets transmitted, 2 received, 0% packet loss, time 1009ms  
rtt min/avg/max/mdev = 0.410/0.459/0.508/0.049 ms  
05:41root@xfrr3 /etc/ansible ?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [October 19, 2018, 12:50pm UTC](https://forum.ansible.com/t/very-first-time-network-engineer-user-ping-module-needs-to-connect-with-ssh-to-work/28826/2 "2018-10-19T12:50:48Z")

</div>

does the other end have your public keys for the user you are running ansible? or the ssh keys loaded??

---

<div class="post-metadata">

**Author:** ![Uwe\_Sauter](https://avatars.discourse-cdn.com/v4/letter/u/41988e/32.png) [@Uwe\_Sauter](https://forum.ansible.com/u/Uwe_Sauter)\
**Post date:** [October 19, 2018, 12:53pm UTC](https://forum.ansible.com/t/very-first-time-network-engineer-user-ping-module-needs-to-connect-with-ssh-to-work/28826/3 "2018-10-19T12:53:53Z")

</div>

The ping module is not the classical ping command but an Ansible module that will connetc to the remote host via SSH and send back  
a "pong" if that succeeds. See the docs.

If you want to use the classical ping command you need to use the "command" or "shell" module to call that from Ansible; but  
beware that this task needs to be run on localhost to reflect what you would usually do on the command line.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [October 19, 2018, 12:54pm UTC](https://forum.ansible.com/t/very-first-time-network-engineer-user-ping-module-needs-to-connect-with-ssh-to-work/28826/4 "2018-10-19T12:54:51Z")

</div>

If you check the documentation[1] it clearly state the following.

&nbsp;&nbsp;&nbsp;ping - Try to connect to host, verify a usable python and return pong on success  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- This is NOT ICMP ping, this is just a trivial test module that requires Python on the remote-node.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [October 19, 2018, 12:55pm UTC](https://forum.ansible.com/t/very-first-time-network-engineer-user-ping-module-needs-to-connect-with-ssh-to-work/28826/5 "2018-10-19T12:55:07Z")

</div>

oh ignore my comment I missed the networking part.

---

<div class="post-metadata">

**Author:** ![gundalow](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gundalow/32/99_2.png) [@gundalow](https://forum.ansible.com/u/gundalow)\
**Post date:** [October 19, 2018, 1:24pm UTC](https://forum.ansible.com/t/very-first-time-network-engineer-user-ping-module-needs-to-connect-with-ssh-to-work/28826/6 "2018-10-19T13:24:04Z")

</div>

Hi,  
Welcome to the Ansible Community

We have some Ansible Network getting started documentation which maybe a good place to start [https://docs.ansible.com/ansible/latest/network/](https://docs.ansible.com/ansible/latest/network/)

Kind regards,  
gundalow
