Courseiva

EX294 Manage task execution and roles Practice Question

Network Topology
[root@control ansible]# ansible-playbook playbook.ymlcheckdiff[root@control ansible]# cat playbook.yml- name: Deploy web apphosts: webserversroles:- common- apache- deployPLAY [Deploy web app] ********************************************************ok: [web1.example.com]changed: [web1.example.com]PLAY RECAP ********************************************************************web1.example.comok=3 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Refer to the exhibit. An administrator runs a playbook in check mode and receives the shown output. What should be done to fix the failure while maintaining idempotency?

⚠ Common exam trap

EX294 often tests the misconception that running without check mode or using force parameters resolves missing directory issues, but the real fix is to ensure the role itself creates required directories idempotently.

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

✓

Add a task in the apache role to create the /var/www/html directory using the file module.

The failure in check mode indicates that the /var/www/html directory does not exist, and the apache role's copy task cannot write to it. The correct fix is to add a task in the apache role that uses the file module to create the directory with the desired state (e.g., state: directory), ensuring idempotency because the task will only create it if absent. This keeps the role self-contained and maintains idempotent behavior.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Modify the deploy role to use the force parameter when copying files.

    Why it's wrong here

    The force parameter on copy overwrites the destination every run, so the task always reports changed and idempotency is lost. The failure stems from a missing directory, which a file task with state: directory should create. It is tempting to silence the copy error, but forcing masks rather than fixes the cause.

  • ✓

    Add a task in the apache role to create the /var/www/html directory using the file module.

    Why this is correct

    Creating the directory with the file module declares the desired state, so repeated runs report no change and idempotency holds. The failure stems from httpd's document root being absent before the copy task runs; the file module with state: directory satisfies that prerequisite declaratively rather than through an imperative shell command.

  • ✗

    Run the playbook without check mode to force the deployment.

    Why it's wrong here

    Running without check mode forces changes and hides the underlying non-idempotent task, so a second run still reports changed. Check mode exists to expose exactly this drift. It is tempting to bypass the error, but the requirement is a playbook that converges without forcing.

  • ✗

    Add a pre_task in the playbook to create /var/www/html before roles execute.

    Why it's wrong here

    A pre_task creating /var/www/html runs before roles, but check mode still reports the role's copy as changed because the directory is absent at check time; the fix belongs in the role's own tasks using a file task with state: directory. It is tempting as a quick ordering fix, yet it does not make the role idempotent.

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.