Ansible Automation Platform execution environments: reproduce the job, not the laptop
Separate controller configuration, execution-environment dependencies and managed-host requirements. Build a reproducibility record for an AAP job that fails only in automation.
TL;DR: An AAP job runs with a selected project revision and execution environment. Reproduce failures using that combination plus the job's inputs, credentials and target inventory; installing a missing package on the controller host usually changes the wrong runtime.
Where the playbook actually runs
Automation controller schedules and records work. An execution environment, or EE, is the container image supplying the automation runtime, collections and supporting dependencies. An execution node runs that environment. The managed host is another boundary: a module executed remotely may need an interpreter or package there even when the EE is complete.
A project supplies playbooks from source control. Its revision and the EE image version can change independently. Recording only a Git commit leaves the runtime unspecified; recording only an image digest leaves the automation code unspecified. See Red Hat's execution-environment overview for the AAP 2.6 model.
A dependency has an execution location
Suppose a cloud inventory plugin imports a Python SDK. Its import happens in the environment running the inventory update. Adding the SDK to a managed Linux host cannot repair that import. Conversely, a remote module failing because its selected Python interpreter lacks a package may require a managed-host fix.
| Evidence | Investigate first | Evidence after correction |
|---|---|---|
| Collection action cannot resolve | Collection version and search path inside EE | Action resolves in the selected image |
| SDK import fails during inventory update | Inventory source's runtime dependencies | Update succeeds and returns expected hosts |
| Remote interpreter fails | Interpreter discovery and target dependencies | Module runs on the affected host |
| Registry pull is denied | Image reference and registry credential | Execution node can fetch the approved image |
Use the failure's task and traceback to locate execution. A successful SSH connection proves little about a local lookup plugin, and a successful project sync proves little about an API call from a different execution node.
Worked comparison: identical source, different image
This teaching fixture has two runs of project commit c42. Yesterday's job used an image containing collection version 4.1; today's image contains 5.0. Both template screens show the same mutable tag, automation:stable. Today a task rejects an argument the previous collection accepted.
First preserve the failed job's details. Compare the actual image identity, collection and Python versions against the successful run, then read the relevant collection's compatibility notes. Do not diagnose this as source drift solely because the project name is unchanged. The proposed dependency mismatch is confirmed only when the job is reproduced with the recorded runtime.
Build and test a new image from reviewed dependency declarations. Promote the resulting image through the registry and reference the approved version in the template. Red Hat documents Ansible Builder dependency inputs. A locked declaration improves repeatability, but availability of the base image and package repositories still matters. Keep the built image as evidence.
Avoid installing packages interactively inside an already-running job. That produces a successful one-off environment with no reviewed source for the next execution.
Keep a useful job evidence record
Capture the job ID, actual project revision, selected EE and resolved image identity where available, inventory source/update, host limit, sanitized effective inputs and credential references. Credential references identify the selected authority without exporting secret values. Record the execution node when network reachability differs between pools.
Red Hat exposes the job's source revision through awx_project_revision and the job's scm_revision field in its launch documentation. A later project sync cannot rewrite which revision an earlier job used. Inventory membership and remote service state may still prevent an exact replay, so preserve the relevant evidence before those change.
Self-check: the playbook works on a developer laptop, and the controller's operating system has the required SDK. Does this establish that the job image contains it? No. Inspect the selected EE and the location of the failing import. The laptop and controller packages do not describe that container filesystem.
Practice the diagnosis in a module missing only inside AAP, then review launch permissions before exposing the repaired job to operators.