ping - Try to connect to host, verify a usable python and return pong on success

Synopsis

  • A trivial test module, this module always returns pong on successful contact. It does not make sense in playbooks, but it is useful from /usr/bin/ansible to verify the ability to login and that a usable python is configured.
  • This is NOT ICMP ping, this is just a trivial test module.
  • For Windows targets, use the win_ping module instead.

Options

parameter required default choices comments
data
no pong
Data to return for the ping return value.
If this parameter is set to crash, the module will cause an exception.

Examples

# Test we can logon to 'webservers' and execute python with json lib.
# ansible webservers -m ping

# Example from an Ansible Playbook
- ping:

# Induce an exception to see what happens
- ping:
    data: crash

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
ping
value provided with the data parameter
success string pong

Notes

Note

  • For Windows targets, use the win_ping module instead.

Status

This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.

Maintenance Info

For more information about Red Hat’s this support of this module, please refer to this knowledge base article<https://access.redhat.com/articles/rhel-top-support-policies>

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/ping_module.html