EX294 Manage task execution and roles Practice Question
An administrator is building a reusable role and must decide how to structure variables so that callers can override values while the role still ships sensible starting values. Which TWO practices are appropriate for this role design? (Choose two.)
⚠ Common exam trap
The trap here is treating defaults and vars as interchangeable, when their precedence difference is what makes one overridable and the other protected.
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
✓
Place values that must not be changed by callers in vars/main.yml so they outrank most other sources.
A well-designed role separates low-precedence starting values from high-precedence internal constants. Defaults give callers an easy override path, while vars/main.yml protects values the role must control. Play vars, inventory host data, and mandatory extra variables all bind the role to a specific context and undermine reuse.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Place values that must not be changed by callers in vars/main.yml so they outrank most other sources.
Why this is correct
Variables in vars/main.yml carry high precedence, above inventory and play variables, so they resist accidental overrides by callers. This makes them suitable for internal constants the role depends on, while still allowing extra variables or role parameters to take precedence when a deliberate change is required.
- ✗
Store role variables in the inventory host file so each host can be tuned individually.
Why it's wrong here
Inventory variables describe hosts, not roles, so they cannot express a role's internal baseline values and they tie the role to a particular inventory. A role relying on host files for its defaults cannot be shared or reused cleanly across projects, which conflicts with the stated design goal.
- ✓
Place starting values in defaults/main.yml so they have low precedence and are easily overridden.
Why this is correct
Files under defaults/ are loaded at the lowest precedence, which is exactly the intent for values a role ships as a starting point. Callers can override them through inventory, play vars, or role vars without editing the role, keeping the role reusable and its baseline behavior documented in one place.
- ✗
Require callers to pass every value as an extra variable with -e on the command line.
Why it's wrong here
Extra variables have the highest precedence and must be supplied on every run, so the role would have no usable defaults and would fail or behave inconsistently when a value is omitted. This approach also makes automation fragile, since any scheduled or CI run must reproduce the full set of -e arguments.
- ✗
Define all role variables in the play's vars section so they are inherited by every role in the play.
Why it's wrong here
Play-level vars apply to all hosts and all roles in that play, which couples unrelated roles together and prevents the role from carrying its own defaults. It also makes the role unusable outside that specific play, so it does not satisfy the goal of a self-contained, reusable role.
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.