Courseiva

EX294 Practice Question: Create content collections and execution environments

An organization uses a private automation hub to distribute collections. A developer has created a new collection and needs to ensure it is available in the hub for others. Which command should the developer use to upload the collection to the private automation hub?

⚠ Common exam trap

Many exam-takers confuse `build` (which only creates the artifact) with `publish` (which uploads it), or they mistakenly think `import` is the correct command for uploading a built artifact, when in fact `import` is for source-based imports from a repository.

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-galaxy collection publish

`ansible-galaxy collection publish` is the command specifically designed to upload a built collection artifact (a .tar.gz file) to a Galaxy server, including a private automation hub. This command sends the collection to the configured Galaxy server endpoint, making it available for others to install via `ansible-galaxy collection install`.

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 import

    Why it's wrong here

    The import subcommand publishes an already-built collection tarball into a Galaxy or Automation Hub repository; uploading to the private hub uses ansible-galaxy collection publish instead. It tempts because import does move artefacts into repositories, which would be correct when syncing a collection into a Galaxy server from a tarball.

  • ✗

    ansible-galaxy collection build

    Why it's wrong here

    Build only compiles the collection directory into a tarball locally; it never contacts the private automation hub, so nothing becomes available to others. It tempts because building is a required prerequisite before publishing, which would be the correct step when packaging the collection prior to upload.

  • ✓

    ansible-galaxy collection publish

    Why this is correct

    `ansible-galaxy collection publish` uploads a built collection tarball to a Galaxy-compatible repository, satisfying the requirement to distribute it via the private automation hub. It authenticates using the API token configured in `ansible.cfg` or passed with `--api-key`, then pushes the artefact so other developers can install it.

  • ✗

    ansible-galaxy collection install

    Why it's wrong here

    Install downloads a collection from a repository onto the local control node; it performs no upload, so the hub gains nothing. It tempts because install is the everyday command for consuming collections, which would be correct when a developer needs the collection available locally for use in playbooks.

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 →

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.