December 2018
Beginner
826 pages
22h 54m
English
Now that we've had a quick look at how Ansible can be used to run jobs on remote machines, let's break down what we did, starting with the ping module:
$ ANSIBLE_HOST_KEY_CHECKING=false ansible -k -m ping -i 192.168.33.11, 192.168.33.11
Let's go over those arguments in order:
-k
Here, -k means that Ansible will know to prompt us for a password, with which we're going to connect to the remote machine (our Vagrant user's SSH password):
-m ping
Here, we're telling Ansible that we want to use the ping module:
-i 192.168.33.11,
Here, we're building an inventory, though admittedly an inventory of one machine.
Ansible needs to know the list of hosts it can work with—its inventory—but here, we only have one, so we're using that ...