Interview Prep/Ansible/Performance, Testing and CI/CD

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.

All Ansible questions Roadmap: Ansible

More on Performance, Testing and CI/CD