EX294 Practice Question: Create content collections and execution environments
During a collection development, a developer wants to include a Python dependency that is not available in the base image of the execution environment. Where should this dependency be declared?
⚠ Common exam trap
Red Hat often tests the distinction between files used for building execution environments (`execution-environment.yml`) versus files used for publishing or runtime metadata (`galaxy.yml`, `meta/runtime.yml`), causing candidates to confuse where Python dependencies should be declared.
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
✓
In the execution-environment.yml under 'dependencies' -> 'python'
In Ansible execution environments, Python dependencies that are not part of the base image must be declared in the `execution-environment.yml` file under the `dependencies` key, specifically within the `python` subkey. This file is used by `ansible-builder` to build a custom container image that includes those additional Python packages. The base image already contains a standard set of Python libraries, but any extra ones needed by a collection must be explicitly listed here to be installed during the build process.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
In the execution-environment.yml under 'dependencies' -> 'python'
Why this is correct
Declaring the dependency under `dependencies` → `python` in `execution-environment.yml` instructs ansible-builder to install it into the execution environment image via pip during the build, satisfying the stem's constraint that the package is absent from the base image.
- ✗
In the collection's requirements.yml under 'python'
Why it's wrong here
requirements.yml declares Ansible collection dependencies, roles and collections, not Python packages; its 'python' key does not install runtime libraries into the execution environment. That file is correct for pulling in collections and roles from Galaxy or Automation Hub.
- ✗
In the collection's galaxy.yml under 'dependencies'
Why it's wrong here
galaxy.yml 'dependencies' lists other Ansible collections this collection requires, not Python packages. It is tempting because it is the manifest's dependency section, but it resolves Galaxy collections at install time; Python libraries must be declared in the execution environment definition so the container image includes them.
- ✗
In the collection's meta/runtime.yml under 'python_dependencies'
Why it's wrong here
meta/runtime.yml declares Ansible collection-level metadata, not Python packages; python_dependencies there is not a valid key. It is tempting because runtime.yml holds execution requirements, but Python dependencies belong in the execution environment definition file (requirements.txt or bindep), which the builder installs into the container.
Go deeper
Related to this question
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 →
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.