EX294 Implement advanced Ansible automation Practice Question
A playbook uses the 'include_tasks' module to dynamically include tasks based on a variable. The playbook runs successfully on some hosts but fails on others with a 'template error' message. What is the most likely cause?
⚠ Common exam trap
Watch out — candidates often confuse the source of the template error, assuming it comes from the content of the included tasks (option D) rather than from the variable used in the include path itself, which is evaluated before the included file is even accessed.
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
✓
The variable used in the 'include_tasks' path has a Jinja2 template error.
The 'include_tasks' module dynamically resolves the path to a task file using a variable. If that variable contains a Jinja2 template error (e.g., undefined variable, syntax mistake, or filter misuse), Ansible will fail with a 'template error' message during the variable expansion phase, before the task file is even loaded. This explains why the error occurs only on hosts where the variable's value or context triggers the template failure.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The included task file does not exist on the control node.
Why it's wrong here
Missing file causes a 'file not found' error.
- ✓
The variable used in the 'include_tasks' path has a Jinja2 template error.
Why this is correct
Template errors occur when Jinja2 syntax is invalid.
- ✗
The included task file has incorrect permissions.
Why it's wrong here
File permissions do not produce template errors.
- ✗
The included tasks contain a syntax error.
Why it's wrong here
A syntax error would be reported as a YAML or Ansible syntax error, not a template error.
Visual reference
Go deeper
Related to this question
About these practice questions
This EX294 question is part of Courseiva's 520-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.