Courseiva

EX294 Manage task execution and roles Practice Question

A team develops a custom Ansible role 'webserver' that depends on another role 'common'. They want to ensure that when 'webserver' is used, 'common' is automatically installed from the same Galaxy server. Which approach should they use?

⚠ Common exam trap

It's easy for candidates to confuse role dependencies (declared in `meta/main.yml`) with playbook-level role ordering or external requirements files, leading them to choose options that manage execution order or manual installation instead of automatic dependency resolution.

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 dependencies: ['common'] to the role's meta/main.yml file.

Ansible roles can declare dependencies in the `meta/main.yml` file using the `dependencies` key. When the 'webserver' role is installed via `ansible-galaxy install`, Ansible automatically resolves and installs all listed dependencies from the same Galaxy server, ensuring 'common' is present without manual intervention.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Add a requirements.yml file in the role's root directory specifying common.

    Why it's wrong here

    requirements.yml is not automatically processed when the role is used; it must be explicitly installed.

  • ✓

    Add a dependencies: ['common'] to the role's meta/main.yml file.

    Why this is correct

    Correct: Role dependencies in meta/main.yml are automatically installed.

  • ✗

    Use ansible-galaxy install webserver --with-dependencies to install common separately.

    Why it's wrong here

    This works but requires the user to remember to use --with-dependencies; not automatic.

  • ✗

    Include the 'common' role in the playbook before 'webserver'.

    Why it's wrong here

    This does not automate installation; common must already be present on the control node.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

One of 392 original EX294 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.