Courseiva

EX294 Implement advanced Ansible automation Practice Question

A new technician runs a playbook that uses the yum module to install packages. The playbook fails with 'No package matching' for a custom package. The package is available on a third-party repository. Which step should the technician take?

⚠ Common exam trap

Candidates often confuse the need to add a repository with other common tasks like importing GPG keys or updating the cache, assuming the package is simply not found due to stale metadata rather than a missing repository source.

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 the repository using the yum_repository module.

The yum module requires that the repository providing the package is already configured on the target system. Since the custom package is on a third-party repository, the technician must first add that repository using the yum_repository module. This module creates the necessary .repo file in /etc/yum.repos.d/, making the package available for installation via the yum module.

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 rpm_key module to import the GPG key.

    Why it's wrong here

    Importing a GPG key only validates package signatures; it does not make the third-party repository available, so yum still cannot resolve the package. It tempts because signature errors are common with external repositories. This step would be correct after the repository is configured and its key is untrusted.

  • ✓

    Add the repository using the yum_repository module.

    Why this is correct

    The yum module resolves packages only from repositories already configured on the managed host. A third-party repository must first be defined, so the yum_repository module adds the repo definition before the install task runs, allowing the custom package to be found.

  • ✗

    Use command: yum install directly.

    Why it's wrong here

    Calling yum install through the command module bypasses Ansible's idempotent yum module and still fails without the repository configured. It tempts because it mirrors manual troubleshooting, but the missing repository definition is the real cause. This would be correct for one-off commands with no module equivalent.

  • ✗

    Update the package cache using yum update.

    Why it's wrong here

    Refreshing the cache with yum update does not add the missing third-party repository, so the package remains undiscoverable. It tempts because stale metadata causes similar failures, but here the repository itself is absent. This step would be correct when a known repository's metadata is outdated.

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.