From the course: Red Hat Certified Engineer (EX294) Cert Prep: 2 Using Ansible Playbooks

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Playbook language

Playbook language

- [Instructor] Playbooks are written in YAML. YAML has a minimum amount of syntax, and is not intended to be a programming language. YAML represents a model of a configuration or process. Let's talk now about the structure of a playbook. A playbook will include a list of one or more plays. A play is a sports analogy. Just as you can run a play in a football game that can do different things at different times, you can run Ansible plays at different times that do different things. Plays map hosts to well-defined roles using tasks. Tasks then execute modules on hosts. Playbooks can have multiple plays that all target different hosts or groups of hosts. This might still be a bit abstract, so let me give you an example. You could have a playbook that would include plays with tasks that target the web servers group. Modules would run on all hosts in this group, and then run other tasks on all hosts in the DNS servers group,…

Contents