Courseiva

EX294 Implement advanced Ansible automation Practice Question

An Ansible playbook runs tasks on a group of web servers. During a rolling update, the playbook should ensure that no more than 2 servers are taken out of service at the same time. Which play keyword should be used?

⚠ Common exam trap

A common mix-up: candidates confuse `serial` (which controls batch size of hosts) with `forks` (which controls parallelism of task execution), leading candidates to pick `forks: 2` thinking it limits concurrency, when in fact it only limits the number of parallel task processes, not the number of hosts taken out of service simultaneously.

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

✓

serial: 2

The `serial` keyword controls the batch size of hosts that Ansible executes a play against. Setting `serial: 2` ensures that only 2 web servers are processed at a time, which is exactly what is needed for a rolling update where no more than 2 servers should be taken out of service simultaneously.

Answer analysis

Option-by-option breakdown

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

  • ✗

    forks: 2

    Why it's wrong here

    forks sets the number of parallel worker processes Ansible spawns per task, not how many hosts are removed from service at once. It is tempting because it limits concurrency, but serial controls rolling-update batch size; forks merely caps total parallelism across the inventory.

  • ✗

    max_fail_percentage: 2

    Why it's wrong here

    max_fail_percentage aborts a play once a percentage of hosts fail, so setting 2 halts after two percent fail — it does not limit hosts taken out of service. It is tempting as a safety control, but serial defines rolling batch size; this keyword governs failure tolerance instead.

  • ✗

    throttle: 2

    Why it's wrong here

    throttle limits how many hosts execute a task concurrently within a batch, but it does not control how many servers leave service simultaneously during a rolling update. It is tempting because it caps parallel execution, yet serial: 1 with a batch size is what actually restricts hosts removed at once.

  • ✓

    serial: 2

    Why this is correct

    The serial keyword controls how many hosts Ansible targets per batch, so serial: 2 limits the rolling update to two servers at a time. This satisfies the constraint that no more than two servers leave service simultaneously.

About these practice questions

This EX294 question is part of Courseiva's 392-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 →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way 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. An Ansible playbook uses a rolling update strategy with serial: 1. After the first host is updated, the playbook stops and shows 'PLAY RECAP' with only one host. What is the most likely reason?

hard
  • A.the playbook has a 'failed_when' condition that stops execution
  • ✓ B.the inventory contains only one host
  • C.the play uses 'delegate_to' incorrectly
  • D.the playbook does not have any task that triggers the next batch, and 'serial' only controls concurrency, not retry

Why B: The `serial: 1` directive in Ansible limits concurrency to one host at a time, but the playbook will still process all hosts in the inventory. If the playbook stops after the first host and shows PLAY RECAP with only one host, the most likely reason is that the inventory contains only one host. With a single host, the play executes on that host and then finishes. Option B accurately identifies this scenario.

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.