EX294 Practice Question: Create content collections and execution environments
Your team maintains a collection that includes custom modules and plugins. You have been tasked with creating a content collection that adheres to the Red Hat Ansible Content Collection requirements. You have created the directory structure and written the collection code. Now you need to package the collection for distribution to your internal automation hub. You run 'ansible-galaxy collection build' and it completes successfully, generating a tarball. However, when you try to publish it to your private automation hub using 'ansible-galaxy collection publish', you get an authentication error. You have verified that your automation hub server URL and API token are correct. What is the most likely cause of the error?
⚠ Common exam trap
It's easy for candidates to assume any error during `publish` with a valid token must be a network or credential issue, overlooking the namespace authorization check that Ansible Automation Hub performs before allowing upload.
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
✓
The 'namespace' or 'name' in galaxy.yml does not match the namespace you are allowed to publish to on the automation hub.
The authentication error despite correct server URL and API token indicates that the issue is not with credentials or connectivity, but with authorization. Ansible Automation Hub enforces namespace-based access control: the `namespace` field in `galaxy.yml` must match a namespace you are permitted to publish to. If the namespace does not match, the hub rejects the upload with an authentication/authorization error, even though the token itself is valid.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The automation hub server is not reachable from your network.
Why it's wrong here
An unreachable server produces a connection timeout or DNS resolution error, not an authentication error, which requires the hub to respond with a 401 or 403. It is tempting because network faults are common, and would be correct if publish failed to connect rather than being refused by the hub.
- ✗
The collection tarball is corrupted and needs to be rebuilt.
Why it's wrong here
A corrupted tarball would fail extraction or checksum validation, yielding a malformed-archive error rather than an authentication failure. It is tempting because build output can be damaged in transit, and would be correct if publish reported an unreadable or invalid tarball instead of rejecting the credentials.
- ✗
The collection contains a module that violates a content policy enforced by the hub.
Why it's wrong here
Content policy violations produce a validation or rejection message during publish, not an authentication error; the hub returns 401/403 only when credentials fail. It is tempting because hubs do enforce policies, and would be correct if the error mentioned a rejected or non-compliant collection rather than authentication.
- ✓
The 'namespace' or 'name' in galaxy.yml does not match the namespace you are allowed to publish to on the automation hub.
Why this is correct
Publishing authenticates the token, but authorisation is scoped per namespace. If galaxy.yml's namespace differs from the one your automation hub account may publish to, the server rejects the upload with an authentication-style error even though the token itself is valid.
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.