How to Abort an Ansible Rolling Update on Any Failure
An Ansible rolling update playbook has 'serial: 1' and 'max_fail_percentage: 0'. During the update of a 5-host group, the first host fails. What is the outcome?
Quick Answer
The play aborts immediately because max_fail_percentage: 0 sets the failure tolerance for the batch to zero, meaning even a single host failure is enough to exceed the threshold and halt execution - with serial: 1, each batch consists of exactly one host, so as soon as that one host fails, 100% of the current batch has failed, which is well above the 0% ceiling that has been configured. Ansible does not wait to see how the remaining hosts would have done, retry the failed host, or skip ahead; it stops the play right there, which is the entire purpose of setting max_fail_percentage that low - it is a deliberate choice to treat any failure during a sensitive rolling update as a signal to stop rather than push forward. This is different from leaving max_fail_percentage unset, where Ansible's default behavior is more tolerant and continues past individual host failures. When a scenario combines a small or single-host serial batch size with a strict max_fail_percentage, the exam is testing whether you understand that the percentage is evaluated per batch, not across the whole inventory, so a tiny batch size makes even one failure disproportionately likely to cross the threshold and abort the run.
⚠ Common exam trap
Many exam-takers assume 'serial: 1' means the play will skip the failed host and continue with the next, but 'max_fail_percentage: 0' overrides that by aborting on any failure.
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 play aborts immediately
With 'serial: 1', Ansible updates one host at a time. 'max_fail_percentage: 0' means that if any host fails (0% failure tolerance), the entire playbook run is aborted immediately. When the first host fails, Ansible stops further execution because the failure percentage exceeds the threshold, and no retries or continuation occur.
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 play pauses for manual intervention
Why it's wrong here
No pause; immediate abort.
- ✗
The play retries the failed host
Why it's wrong here
No retry logic is configured.
- ✓
The play aborts immediately
Why this is correct
Any failure with max_fail_percentage: 0 aborts the entire play.
- ✗
The play continues with the remaining 4 hosts
Why it's wrong here
max_fail_percentage: 0 aborts on any failure.
- ✗
The play marks the host as unreachable and continues
Why it's wrong here
Failure triggers abort, not ignore.
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 →
Same concept, more angles
3 more ways this is tested on EX294
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company uses Ansible to manage rolling updates of a web server fleet. During a deployment, the playbook fails on one host due to a transient network error, and the rest of the fleet is left in an inconsistent state. Which strategy would best minimize the risk of inconsistency in future rolling updates?
medium- A.Add retries to each task so transient errors are automatically retried.
- B.Use a larger serial batch size to complete the rollout faster.
- C.Set ignore_errors: yes on all tasks to continue despite failures.
- ✓ D.Set max_fail_percentage to 0 in the serial block to abort the rollout on any failure.
Why D: Setting `max_fail_percentage: 0` in a rolling update (using `serial`) tells Ansible to abort the entire playbook run if any single host fails. This prevents the rest of the fleet from being updated, avoiding an inconsistent state where some hosts have the new deployment and others do not. It directly addresses the risk of partial rollouts caused by transient errors.
Variation 2. An Ansible rolling update playbook includes 'max_fail_percentage: 20'. If more than 20% of hosts fail during any batch, what happens?
medium- A.The play pauses and waits for user input
- B.The failed hosts are removed from inventory
- C.The play retries failed hosts
- ✓ D.The play aborts immediately
- E.The play continues with remaining hosts
Why D: The `max_fail_percentage` parameter in Ansible's rolling update strategy defines the maximum percentage of hosts that can fail in a single batch before the playbook aborts entirely. When the failure rate exceeds this threshold, Ansible stops execution immediately to prevent cascading failures or inconsistent state across the remaining hosts.
Variation 3. Which TWO Ansible playbook parameters directly control the number of host failures allowed before aborting a rolling update?
hard- ✓ A.max_fail_percentage
- ✓ B.any_errors_fatal
- C.throttle
- D.serial
- E.ignore_errors
Why A: `max_fail_percentage` directly specifies the maximum percentage of hosts that can fail during a rolling update before Ansible aborts the entire batch. Option B is correct because `any_errors_fatal` causes the playbook to stop immediately if any host in the current batch fails, effectively limiting failures to zero before aborting the rolling update.
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.