Hello Ansible

As we have seen in the previous chapter, it is possible to use Ansible to automate simple tasks that you probably already perform daily.

Let's start by checking if a remote machine is reachable; in other words, let's start by pinging a machine. The simplest way to do this, is to run the following:

$ ansible all -i HOST, -m ping

Here, HOST is an IP address, the Fully Qualified Domain Name (FQDN), or an alias of a machine where you have SSH access (you can use a Kernel-based Virtual Machine (KVM), as we have seen in the previous chapter).

Tip

After the "HOST," the comma is mandatory, because otherwise it would not be seen as a list, but as a string.

In this case, we have performed it against a virtual machine on our system:

$ ansible all ...

Get Learning Ansible 2 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.