EX294 Implement advanced Ansible automation Practice Question
A playbook uses the copy module to deploy a configuration file. The file should be templated with variables, but the engineer mistakenly uses the 'src' parameter with a static file instead of 'content' or a template module. What is the most likely outcome?
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 file is copied without variable substitution, resulting in literal Jinja2 syntax in the destination.
The copy module with the 'src' parameter copies a file without any processing of Jinja2 templates. It does not perform variable substitution. Therefore, if the source file contains Jinja2 syntax (e.g., {{ variable }}), it will be copied literally to the destination. The correct answer is B. Option A is incorrect because the copy module does not automatically render templates. Option C is incorrect because the playbook will not fail due to undefined variables; it simply copies the file as-is. Option D is incorrect because the task will execute and copy the file, not skip.
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 module automatically renders the Jinja2 template before copying.
Why it's wrong here
The copy module performs no Jinja2 rendering; it transfers src bytes verbatim, so placeholders remain literal. Automatic rendering is the behaviour of the template module, which would be correct here because the file must be templated with variables before deployment.
- ✓
The file is copied without variable substitution, resulting in literal Jinja2 syntax in the destination.
Why this is correct
The copy module's src parameter transfers the file verbatim, so Jinja2 placeholders such as {{ variable }} remain unrendered. Variable substitution only occurs through the template module or the content parameter, satisfying the stem's templating requirement.
- ✗
The playbook fails because the source file contains undefined variables.
Why it's wrong here
The copy module transfers the source file verbatim; undefined variables inside it are never parsed, so deployment succeeds with literal placeholders. It is tempting because undefined variables do cause failures, which is the correct outcome when using the template module with an undefined variable in the Jinja2 source.
- ✗
The task is skipped because copy cannot handle variables.
Why it's wrong here
The copy module does not evaluate Jinja2 syntax in a static src file, so the file deploys with literal {{ variable }} placeholders intact; it is not skipped. Skipping occurs only when a conditional such as 'when' evaluates false, which is unrelated to variable handling.
Go deeper
Related to this question
About these practice questions
One of 392 original EX294 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.