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.
Am 19.10.18 um 14:49 schrieb Greg Focaccio:
> 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 ?
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/05574f2c-3e50-4cb6-867c-b1e819132642%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/05574f2c-3e50-4cb6-867c-b1e819132642%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/62a0ad82-d39b-3aeb-7ee7-3fd59acc6175%40gmail.com.
For more options, visit https://groups.google.com/d/optout.