EX294 Practice Question: Create content collections and execution environments
Your team maintains a collection that depends on a module requiring the Python library netaddr. You are building an execution environment with ansible-builder and need that library available inside the image at run time. The collection itself is installed from a private Automation Hub. Which approach ensures the Python dependency is present in the execution environment?
⚠ Common exam trap
Watch out — candidates often confuse collection dependencies with Python dependencies, leading to placing a pip package in the Galaxy requirements list.
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 netaddr to the requirements.txt referenced by the dependencies.python section of execution-environment.yml.
Python libraries needed by modules must be installed into the execution environment image during the build. The dependencies.python section of execution-environment.yml references a pip requirements file, and listing netaddr there causes ansible-builder to install it into the image. Collection metadata and Galaxy dependency lists do not install Python packages, and installing on the control node has no effect inside the container.
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 netaddr to the requirements.txt referenced by the dependencies.python section of execution-environment.yml.
Why this is correct
The dependencies.python section of execution-environment.yml points to a requirements.txt that ansible-builder installs into the image. Listing netaddr there ensures the Python library is present for the module at run time. This is the supported way to add Python packages to an execution environment and works regardless of where the collection itself is hosted.
- ✗
List netaddr under dependencies.galaxy in execution-environment.yml so ansible-galaxy installs it with the collection.
Why it's wrong here
dependencies.galaxy is for Ansible collections, not Python libraries. ansible-galaxy cannot install a Python package such as netaddr from a Galaxy requirements file, so this would fail to provide the library. Python dependencies must go through dependencies.python and a pip requirements file, not the Galaxy dependency list.
- ✗
Install netaddr on the control node and rely on the module using the control node's Python environment.
Why it's wrong here
Execution environments run in containers with their own Python environment. Installing netaddr on the control node does not make it available inside the execution environment, so the module would still fail. The library must be installed into the image during the build, typically via dependencies.python.
- ✗
Add netaddr to the collection's runtime.yml under the requires_ansible key.
Why it's wrong here
The runtime.yml metadata file can declare the minimum Ansible version and other collection metadata, but it does not install Python packages. Adding netaddr there would not cause the library to be present in the execution environment. Python dependencies for modules are managed through the image build, not through collection metadata.
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 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.