EX294 Implement advanced Ansible automation Practice Question
Which THREE of the following are valid uses of the 'ansible.builtin.include_role' module?
⚠ Common exam trap
Many candidates confuse 'include_role' with 'import_role', assuming that tags applied to the include statement will automatically apply to all tasks inside the role, but in Ansible, tags on a dynamic include only affect the include task itself, not the included tasks.
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
✓
Pass variables to the included role using the 'vars' keyword.
The 'ansible.builtin.include_role' module supports the 'vars' keyword to pass variables directly to the included role. This allows you to override or supply role variables at the point of inclusion, which is a common pattern for reusing roles with different configurations.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Pass variables to the included role using the 'vars' keyword.
Why this is correct
Variables can be passed to the role via the 'vars' parameter.
- ✓
Include a role from a collection by specifying 'namespace.collection.role_name'.
Why this is correct
Collections can be referenced with the full qualified collection name.
- ✗
Dynamically set the role name using a variable without the 'name' parameter.
Why it's wrong here
The role name must be specified with the 'name' parameter.
- ✓
Conditionally include a role based on a variable.
Why this is correct
include_role supports 'when' conditionals.
- ✗
Apply tags to all tasks within the included role.
Why it's wrong here
Tags are applied at the include level, not propagated to all tasks.
Go deeper
Related to this question
About these practice questions
This EX294 question is part of Courseiva's 392-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.