Ansible

Now, you would have thought that ansible is going to be the most common command we will be using throughout this book, but it isn't.

The ansible command is really only ever used for running ad hoc commands again in a single or collection of hosts. In the last chapter, we created a host inventory file that targeted a single local virtual machine. For this chapter, let's take a look at targeting four different hosts running in DigitalOcean; my hosts file looks as follows:

ansible01 ansible_host=46.101.92.240ansible02 ansible_host=159.65.63.218ansible03 ansible_host=159.65.63.217ansible04 ansible_host=138.68.145.116[london]ansible01ansible02
[nyc]ansible03ansible04[digitalocean:children]londonnyc[digitalocean:vars]ansible_connection=ssh ...

Get Learn Ansible 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.