Testing

To verify that Ansible is working correctly and that we can successfully connect and run commands remotely, let's use ping with Ansible to check one of our hosts. Note: this is not like a network ping; Ansible's ping confirms that it can communicate via SSH and execute commands remotely:

$ ansible mon1 -m ping  

Excellent, that worked. Now let's run a simple command remotely to demonstrate Ansible's capabilities. The following command will retrieve the currently running kernel version on the specified remote node:

$ ansible mon1 -a 'uname -r'