Ansible Tools: The Ping Module

Ansible Ping

What Ansible Ping does

Ansible ping is a great way to test if ansible can connect to remote hosts and execute commands. This is different from a 'network ping', in that it not only tests network connectivity, but it tests SSH connectivity and also checks to make sure Python is installed on the remote hosts. This is a simple module to take advantage of so let's get into it.

Inventory file

We have a basic inventory file. Set yours up to match your environment.

node1 ansible_host=
node2 ansible_host=
node3 ansible_host=

Running Ansible Ping

Here is the command I used to run Ansible ping:

ansible -i hosts servers -m ping