Courseiva

EX294 Manage task execution and roles Practice Question

What is the purpose of the 'meta: flush_handlers' task?

⚠ Common exam trap

Watch out — candidates often confuse 'flush_handlers' with simply waiting for handlers to complete (Option C), not realizing that flush_handlers actively forces immediate execution of the handler queue, rather than passively waiting for the default end-of-play 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

✓

Force handlers to run immediately

The 'meta: flush_handlers' task in Ansible is used to force any pending handler notifications to run immediately at that point in the play, rather than waiting until the end of the play. This is correct because it ensures that handlers triggered by earlier tasks execute right away, which is essential when subsequent tasks depend on the state changes those handlers make (e.g., restarting a service before configuring it further).

Answer analysis

Option-by-option breakdown

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

  • ✗

    Restart services immediately

    Why it's wrong here

    Handlers restart services only when notified by a changed task; flush_handlers itself issues no restart command. It triggers whatever handlers are already queued. Forcing an unconditional restart mid-play is what an explicit service task with state: restarted achieves.

  • ✗

    Clear the handler queue

    Why it's wrong here

    flush_handlers executes queued handlers rather than discarding them; the queue empties as a consequence of running them, not by deletion. Clearing without running matches no Ansible mechanism. The task is for running handlers early, mid-play, when later tasks need the change applied.

  • ✗

    Wait for handlers to complete

    Why it's wrong here

    flush_handlers runs pending handlers at that point in the play; it does not wait for anything. Waiting is what handlers notified earlier do at play end anyway. The task suits forcing handler execution mid-play, before subsequent tasks depend on the restarted service.

  • ✓

    Force handlers to run immediately

    Why this is correct

    The meta: flush_handlers task interrupts the current play and executes all handlers notified so far, rather than waiting until the end of the play. This forces immediate handler execution at that point in the task sequence.

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

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.