EX294 Manage task execution and roles Practice Question
An administrator needs to ensure that a task runs only on the first host in a batch and that its result is applied to all hosts in the batch. Which Ansible directive should be used?
⚠ Common exam trap
Many candidates confuse 'run_once' with delegation or serial batching, which control different aspects of execution.
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
✓
run_once: true
The 'run_once: true' directive ensures a task runs only on the first host in the batch and that the results are applied to all hosts. This is ideal for one-time operations. The other options either delegate to the control node, change batching, or affect error handling, none of which satisfy the specific requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
run_once: true
Why this is correct
'run_once: true' forces the task to execute on only one host (the first host in the current batch) and applies the results to all hosts in the play. This is exactly the requirement. It is commonly used for tasks like database migrations or cluster initialization that should happen only once, with the outcome affecting all hosts.
- ✗
delegate_to: localhost
Why it's wrong here
'delegate_to: localhost' runs the task on the control node, not on the first host in the batch. It does not automatically apply results to all hosts. While it can be used for tasks that should run once, it does not fulfill the requirement of running on the first host and sharing results across the batch. It is a different mechanism for delegation.
- ✗
serial: 1
Why it's wrong here
'serial: 1' controls the number of hosts processed in each batch, but it does not limit task execution to the first host. It simply runs the entire play on one host at a time. This would cause the task to run on every host, not just the first. Therefore, it does not meet the requirement and is not the correct directive.
- ✗
any_errors_fatal: true
Why it's wrong here
'any_errors_fatal: true' makes the play fail for all hosts if any host encounters an error, but it does not control where a task runs or share results. It is unrelated to the requirement of running a task on only the first host. This option is a distractor based on a common play-level directive that serves a different purpose.
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.