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.
If you check the documentation[1] it clearly state the following.
ping - Try to connect to host, verify a usable python and return pong on success
- This is NOT ICMP ping, this is just a trivial test module that requires Python on the remote-node.