EX294 Practice Question: Create content collections and execution environments
An organization wants to include custom Python packages in their execution environment to support custom modules. Which method should be used to define these Python dependencies?
⚠ Common exam trap
Test-takers frequently confuse the file used for Ansible collections (`galaxy-requirements.yml` or `collection-requirements.yml`) with the file used for Python dependencies, leading them to pick options A or D instead of recognizing the correct `execution-environment.yml` structure.
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
✓
Create a `requirements.txt` file and reference it in the `execution-environment.yml` under `dependencies: python:`.
The `execution-environment.yml` file supports a `dependencies` key with a `python` subkey that points to a `requirements.txt` file. This is the standard method defined by the Ansible Builder specification for including custom Python packages in an execution environment, ensuring they are 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.
- ✗
List them in the `galaxy-requirements.yml` file.
Why it's wrong here
galaxy-requirements.yml declares Ansible collections and roles, not Python packages, so pip dependencies for custom modules are never installed. It is tempting because it is the standard requirements file for content in an execution environment, and it would be correct when only collections and roles must be listed.
- ✗
Use `ansible-navigator` to install them during runtime.
Why it's wrong here
Runtime installation via ansible-navigator does not define dependencies in the execution environment definition, so builds are not reproducible and offline hosts fail. It is tempting because ansible-navigator can install collections and roles at runtime, which suits ad-hoc local runs rather than declared, portable environment images.
- ✓
Create a `requirements.txt` file and reference it in the `execution-environment.yml` under `dependencies: python:`.
Why this is correct
Ansible Builder reads the python section of dependencies and passes the referenced requirements.txt to pip inside the build, so custom Python packages land in the execution environment image and the custom modules can import them at runtime.
- ✗
Add them to the `collection-requirements.yml` file.
Why it's wrong here
collection-requirements.yml lists Ansible collections for installation, not Python libraries, so the custom modules' pip dependencies remain absent. It is tempting because it is the recognised requirements file for execution environment content, and it would be correct when the dependencies needed are collections rather than Python packages.
Go deeper
Related to this question
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 →
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.