thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

DevOps & Automation · Intermediate

Ansible Role

A standardized directory structure that packages tasks, handlers, variables, templates, and files for reuse across playbooks.

Definition

Roles have directories like tasks/, handlers/, defaults/, vars/, templates/, files/, and meta/. They are created with ansible-galaxy role init and included with roles: or include_role.

Example

roles: [ common, ntp, snmp ]

Exam tip

defaults/ has the lowest variable precedence and is meant to be overridden; vars/ is higher.

Related terms