An organization uses a private Git repository to store Ansible content collections. They want to automate the building of execution environments that include these collections. Which approach is recommended?
Publishing to Automation Hub is the standard method for managing collections in execution environments.
Why this answer
Option D is correct because the recommended workflow for including private collections in an execution environment is to build the collection, publish it to a private Automation Hub, and then reference it in the `execution-environment.yml` file. This ensures the collection is available as a signed, versioned artifact that `ansible-builder` can pull during the build process, maintaining integrity and reproducibility without exposing Git credentials or requiring network access during build.
Exam trap
The trap here is that candidates assume Git repositories can be directly referenced in the execution environment definition file, but the EX294 exam expects you to know that only Galaxy or Automation Hub sources are valid, and that private collections must be published to a private Automation Hub first.
How to eliminate wrong answers
Option A is wrong because Git LFS stores large files, not tarballs of collections, and using an ADD command in a Containerfile bypasses the dependency resolution and signing provided by Automation Hub, leading to potential version mismatches. Option B is wrong because the `execution-environment.yml` file does not support a 'git' type source; it only supports 'galaxy' or 'automation_hub' types for pulling collections from a Galaxy server or Automation Hub. Option C is wrong because `ansible-builder` does not support pre-build scripts that clone repositories; it builds execution environments from a definition file and expects collections to be available from a configured Galaxy or Automation Hub source, not from arbitrary Git clones.