Courseiva

EX294 Practice Question: Create content collections and execution environments

An automation engineer is preparing an execution environment for a project that requires the `community.general` collection and the `netaddr` Python library. The engineer has created an `execution-environment.yml` file in the project directory. Which command should be used to build the execution environment image?

⚠ Common exam trap

Many exam-takers confuse the collection packaging command `ansible-galaxy collection build` with the execution environment build command `ansible-builder build`.

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

✓

ansible-builder build --file execution-environment.yml

The `ansible-builder build` command is the correct tool to create an execution environment image from an `execution-environment.yml` definition. It parses the definition, installs collections and Python dependencies, and produces a container image. Other commands like `ansible-galaxy collection build` or `podman build` serve different purposes and do not automate the execution environment creation 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.

  • ✗

    ansible-galaxy collection build

    Why it's wrong here

    `ansible-galaxy collection build` is used to package an Ansible collection into a tarball for distribution, not to build an execution environment container image. It operates on a collection's `galaxy.yml` and produces a `.tar.gz` artifact. This command does not create container images or handle Python dependencies for execution environments.

  • ✗

    ansible-navigator build execution-environment.yml

    Why it's wrong here

    `ansible-navigator` is a tool for running and developing Ansible content, not for building execution environments. It can run playbooks inside an execution environment, but it does not have a `build` subcommand. Building an execution environment is specifically the domain of `ansible-builder`.

  • ✗

    podman build -t my-ee:latest .

    Why it's wrong here

    While `podman build` can build container images from a Containerfile, it does not interpret the `execution-environment.yml` file or automatically install collections and Python dependencies. Using it directly would require manually writing a Containerfile with all necessary steps. The `ansible-builder` tool is designed to generate that Containerfile and orchestrate the build.

  • ✓

    ansible-builder build --file execution-environment.yml

    Why this is correct

    The `ansible-builder build` command reads the execution environment definition file (by default `execution-environment.yml` in the current directory) and builds a container image. The `--file` flag can explicitly specify the definition file, though it is optional when the file has the default name. This command is the standard way to create an execution environment image from a definition.

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 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.