Courseiva
Manage task execution and roleshardMultiple SelectObjective-mapped

EX294 Manage task execution and roles Practice Question

Which THREE are valid methods to control task execution in Ansible?

⚠ Common exam trap

It's easy for candidates to confuse 'register' (which stores output) with a control flow mechanism, or they mistakenly think 'with_items' is still a valid method for controlling task execution, when in fact the exam expects knowledge of the modern 'loop' keyword and the deprecation of 'with_items'.

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

Using the 'when' conditional

The 'when' conditional in Ansible allows you to control whether a task runs based on the evaluation of a condition, such as a variable, fact, or the result of a previous task. This is a primary method for conditional execution, enabling tasks to be skipped when the condition is false, directly controlling task execution flow.

Answer analysis

Option-by-option breakdown

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

  • Using the 'when' conditional

    Why this is correct

    'when' controls task execution based on conditions.

  • Using 'block' to group tasks for error handling

    Why this is correct

    Block with rescue/always controls execution flow on errors.

  • Using 'register' to store task output

    Why it's wrong here

    Register stores results but does not control execution.

  • Using 'loop' to iterate over a list

    Why this is correct

    Loop repeats a task for each item in a list.

  • Using the 'with_items' loop

    Why it's wrong here

    'with_items' is deprecated; 'loop' is the modern method.

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 →

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.