Developers complain that the Ansible toolchain differs across laptops and CI.
AdvancedScenarioPerformance, Testing and CI/CD
Answer
Situation read → Reproducibility.
What I'd do → Build an Execution Environment with ansible-builder, and run it locally with ansible-navigator.
# execution-environment.yml
version: 3
images:
base_image: { name: quay.io/ansible/ansible-runner:latest }
dependencies:
galaxy: requirements.yml
python: requirements.txt
system: bindep.txt
ansible-builder build -t acme/ee:1.0
ansible-navigator run site.yml --eei acme/ee:1.0 -m stdout
Why → Same image in AWX, CI and laptops means same behaviour.
Interview tip → EEs replaced Tower's virtualenvs.
More on Performance, Testing and CI/CD
A playbook that touches 200 hosts takes 40 minutes. Where do you start tuning?IntermediateYou install 15 packages with a loop and it is slow.BeginnerHow would you test a role in CI before it reaches production?IntermediateWhat would a Molecule `verify.yml` check for an Nginx role?IntermediateMolecule's idempotence step fails. How do you find the offending task?IntermediateDesign a CI pipeline for an Ansible repo.Advanced