Interview Prep/Ansible/Playbooks, Plays, Tasks and Handlers

What is a playbook?

BeginnerConceptPlaybooks, Plays, Tasks and Handlers
Answer

A playbook is a YAML file containing a list of plays. Each play maps a group of hosts to an ordered list of tasks, where each task calls one module with arguments. It is the reusable, version-controlled replacement for a sequence of ad-hoc commands.

- name: Configure web servers
  hosts: web
  become: true
  tasks:
    - name: Install nginx
      ansible.builtin.package:
        name: nginx
        state: present
All Ansible questions Roadmap: Ansible

More on Playbooks, Plays, Tasks and Handlers