Chapter 2. Ansible Playbooks

In the previous chapter, we provided an overview of when ad-hoc commands are helpful. However, in most cases, you will need to perform more complex actions which involves running multiple tasks instead of just one. In addition, it is important to ensure that every time we invoke our automation, we can expect the same result.

To accomplish each of these goals, you will require an Ansible Playbook. Playbooks are the core on Ansible. In the chapter, you will learn what an Ansible Playbook is, and see the most common parts of aplaybook that you might encounter or need. You will also run your first playbook.

Finally, you’ll create a very simple web application, and you’ll deploy to a virtual machine using Ansible.

What is an Ansible Playbook?

An Ansible Playbook is a list of tasks that are automatically executed for a specified set of nodes.

One or more Ansible tasks can be combined to make a play. A play ...

Get Red Hat Certified Engineer (RHCE) Ansible Automation Study Guide 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.