What is a role and why use one?
BeginnerConceptRoles, Collections and Galaxy
Answer
A role is a standard directory layout that packages tasks, handlers, templates, files and variables for one purpose, such as nginx or postgres. Playbooks then become a short list of roles applied to host groups.
Benefits: reuse across projects, a single place to test and version the logic, a documented variable interface, and smaller playbooks that read like an architecture diagram.
More on Roles, Collections and Galaxy
What is the standard role directory structure?BeginnerHow do you scaffold a new role?BeginnerWhat are the ways to use a role in a play?IntermediateHow do role dependencies work?IntermediateIf a role is included twice in a play, does it run twice?AdvancedHow do you pass parameters to a role?Intermediate