EX294 Ansible Role Practice Question
Which two statements about Ansible roles are correct? (Select exactly 2.)
⚠ Common exam trap
EX294 often tests the misconception that roles require a meta/main.yml file or that they are a type of playbook, when in fact meta is optional and roles are separate reusable components invoked by playbooks.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Roles can include tasks, handlers, variables, and defaults.
Option C is correct because an Ansible role is a structured directory layout that can bundle tasks (tasks/main.yml), handlers (handlers/main.yml), variables (vars/main.yml), and defaults (defaults/main.yml) along with files, templates, and meta, allowing reusable automation content. Option E is correct because roles can be installed from Ansible Galaxy using the ansible-galaxy role install command (e.g., ansible-galaxy install geerlingguy.nginx), which fetches roles from Galaxy or a configured requirements file. Option A is not required: meta/main.yml is optional and only needed when declaring role dependencies or Galaxy metadata. Option B is inaccurate because a role is a reusable content structure invoked by a playbook via roles or include_role/import_role, not itself a playbook. Option D is false because include_role is specifically used to dynamically include roles at runtime.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Roles must have a meta/main.yml file.
Why it's wrong here
meta/main.yml is optional; it only declares role dependencies and Galaxy metadata, so roles run without it. It is tempting because Galaxy-published roles conventionally include it, and this would be correct if the statement described roles distributed through Ansible Galaxy rather than all roles.
- ✗
Roles are a type of playbook.
Why it's wrong here
Roles are a directory structure of tasks, handlers, defaults, vars and templates loaded by a play, not a playbook themselves; a playbook references roles. It is tempting because roles are consumed via the roles keyword inside a play, and this would be correct if the statement described role inclusion within a play.
- ✓
Roles can include tasks, handlers, variables, and defaults.
Why this is correct
A role's directory structure defines separate subdirectories for tasks, handlers, variables and defaults, each loaded automatically during role execution. This satisfies the stem's requirement for a correct structural statement, distinguishing roles from loose playbooks that must declare such content inline.
- ✗
Roles cannot be used with include_role.
Why it's wrong here
include_role exists precisely to load a role dynamically at runtime within tasks, so the claim that roles cannot be used with it is false. It is tempting because import_role is static and processed at parse time, and this would be correct if the statement referred to import_role's static behaviour instead.
- ✓
Roles can be installed from Galaxy.
Why this is correct
Ansible Galaxy is the public repository for distributing and installing community roles, and the ansible-galaxy install command retrieves them into the roles path. This satisfies the stem's requirement for a correct statement about role sourcing, since roles are not limited to locally authored content.
Go deeper
Related to this question
About these practice questions
Courseiva writes every EX294 question from scratch — 392 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Red Hat exam blueprint
This EX294 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX294 exam.