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.

About playbook roles

About playbook roles

- [Instructor] Roles allow us to group content and allow easy sharing of configuration data for reuse on other systems. By using roles, we can automatically load variable files, tasks and handlers, all based on the file system structure. There are standard directories that can be used on roles. These directories will be automatically processed for the role. In this example, the web servers rule. Each role has to have at least one of these directories. Each directory included must have a main.yml file in it. The task directory contains the main list of tasks to be executed by the role. The handlers directory contains change handlers used by this role. Note that handlers in this directory can also be used outside of the role. The files directory contains files that can be deployed by the role. The templates directory contains templates for the role. The vars directory allows us to store non-default variables for the role.…

Contents