Courseiva
Coordinate rolling updatesmediumMultiple ChoiceObjective-mapped

Ansible Serial Batch Size: Calculation and Valid Values

An Ansible playbook sets 'serial: 20%' for rolling updates, but the inventory contains 5 hosts. How many hosts are updated simultaneously?

Quick Answer

The answer is 1 because serial: 20% is evaluated as a percentage of the total inventory size at the time the play runs, and Ansible recalculates that number for whatever inventory it is actually working against rather than using a fixed count baked into the playbook. With 5 hosts in inventory, 20% of 5 works out to exactly 1.0, so the batch size for this run is 1 host at a time - there is no fractional host to round, but even when the math does not land on a whole number, Ansible rounds down rather than up, so a value like 22% of 5, which is 1.1, would still result in a batch size of 1, never 2. This matters because the same serial: 20% setting would produce a completely different batch size against a larger inventory, so the percentage form is really about scaling the rollout to the size of the fleet rather than specifying a fixed number of hosts. Whenever a question gives you a percentage-based serial value along with a specific inventory count, the way to solve it is to multiply the percentage by the total host count and round down to the nearest whole host, since Ansible never updates more hosts in a batch than that percentage actually allows.

⚠ Common exam trap

Test-takers frequently assume percentages are rounded up or that a fractional result like 1.0 would be treated as 2, but Ansible uses floor rounding (truncation) for serial batch sizes, and with exactly 1.0, the result is 1, not 2.

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

1

When 'serial: 20%' is set in an Ansible playbook, the percentage is calculated based on the total number of hosts in the inventory. With 5 hosts, 20% of 5 equals 1.0, which is rounded down to 1. Therefore, only 1 host is updated at a time during the rolling update.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • 1

    Why this is correct

    20% of 5 is 1 host per batch.

  • 2

    Why it's wrong here

    20% rounds down to 1, not 2.

  • 3

    Why it's wrong here

    20% of 5 is 1, not 3.

  • 0

    Why it's wrong here

    20% of 5 is 1, not 0.

  • 5

    Why it's wrong here

    5 would be 100%, not 20%.

About these practice questions

One of 520 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 →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 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. What is the effect of setting 'serial: 5' in an Ansible playbook that targets a group of 20 hosts?

easy
  • A.The playbook runs on 5 hosts per task, then moves to next task.
  • B.The playbook runs on 5 hosts at a time, sequentially.
  • C.The playbook runs only on the first 5 hosts.
  • D.The playbook runs on all 20 hosts at once.

Why B: Setting 'serial: 5' in an Ansible playbook configures the playbook to execute each task on a batch of 5 hosts at a time, moving to the next batch only after the current batch completes all tasks. This ensures that no more than 5 hosts are processed concurrently, providing controlled, sequential rolling updates across the 20-host group.

Variation 2. Which THREE of the following are valid 'serial' values for an Ansible rolling update playbook?

easy
  • A.serial: [1,2,3]
  • B.serial: 50%
  • C.serial: 1
  • D.serial: '25%'
  • E.serial: 'batch'

Why A: Options A, B, and C are all valid 'serial' values for an Ansible rolling update playbook. Ansible's 'serial' keyword controls how many hosts are updated at a time. It accepts an integer (e.g., 1), a percentage string without quotes (e.g., 50%), or a list of integers (e.g., [1,2,3]) to specify varying batch sizes sequentially. Option D is invalid because quoting the percentage (e.g., '25%') treats it as a YAML string that includes the quotes, which Ansible does not interpret correctly. Option E 'batch' is not a valid value.

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.