Courseiva

EX294 Manage task execution and roles Practice Question

An administrator wants to apply a role to a subset of hosts based on a condition. The condition should be evaluated for each host individually. Which approach is correct?

⚠ Common exam trap

The trap here is thinking that tags or other directives can conditionally apply roles per host, when 'when' is the correct mechanism.

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

✓

Use the 'when' directive on the role inclusion in the play.

The 'when' directive on a role inclusion evaluates the condition for each host, applying the role only where the condition is true. This is the correct method for per-host conditional role application. Tags, become, and delegate_to serve different purposes and do not provide conditional execution based on host-specific variables.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Use the 'tags' directive on the role and run the playbook with '--tags'.

    Why it's wrong here

    Tags are used to select which tasks or roles to run from the command line, not to evaluate host-specific conditions. They do not provide per-host conditional execution. Using tags would require manual selection and cannot dynamically apply a role based on host facts or variables. This approach does not meet the requirement.

  • ✗

    Use the 'become' directive on the role to control privilege escalation.

    Why it's wrong here

    'become' controls privilege escalation, not conditional application. It determines whether tasks run with elevated privileges, not whether they run at all. It is unrelated to applying a role conditionally per host. This option is a distractor based on a common role keyword that serves a different purpose.

  • ✗

    Use the 'delegate_to' directive on the role to target specific hosts.

    Why it's wrong here

    'delegate_to' is used to run tasks on a different host than the one being managed, but it does not conditionally apply a role. It changes the execution target, not the condition for running. It cannot be used to apply a role only to hosts that meet a condition. This option misinterprets the purpose of delegation.

  • ✓

    Use the 'when' directive on the role inclusion in the play.

    Why this is correct

    Applying 'when' to a role inclusion (e.g., 'roles: - role: myrole when: condition') evaluates the condition per host. If true, the role is applied to that host. This is the standard way to conditionally apply roles on a per-host basis, ensuring the role's tasks run only where the condition is met.

About these practice questions

Courseiva writes every EX294 question from scratch — 392 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Red Hat exam blueprint

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.