ansible.builtin.ping – Try to connect to host, verify a usable python and return
pong on success¶
This module is part of
ansible-base and included in all Ansible
installations. In most cases, you can use the short module name
ping even without specifying the
Despite that, we recommend you use the FQCN for easy linking to the module
documentation and to avoid conflicting with other collections that may have
the same module name.
A trivial test module, this module always returns
pongon successful contact. It does not make sense in playbooks, but it is useful from
/usr/bin/ansibleto verify the ability to login and that a usable Python is configured.
This is NOT ICMP ping, this is just a trivial test module that requires Python on the remote-node.
For Windows targets, use the ansible.windows.win_ping module instead.
For Network targets, use the ansible.netcommon.net_ping module instead.
Data to return for the
If this parameter is set to
# Test we can logon to 'webservers' and execute python with json lib. # ansible webservers -m ping - name: Example from an Ansible Playbook ansible.builtin.ping: - name: Induce an exception to see what happens ansible.builtin.ping: data: crash