Skip to Content
Linux Administration Cookbook
book

Linux Administration Cookbook

by Adam K. Dean
December 2018
Beginner
826 pages
22h 54m
English
Packt Publishing
Content preview from Linux Administration Cookbook

How it works...

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9781789342529Supplemental Content