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

How do you build and test an Execution Environment in CI?

AdvancedProductionTesting, CI/CD and Quality
Answer

The EE is the runtime for every job, so it gets the same pipeline as any container image: build, test, scan, push, promote.

# execution-environment.yml
version: 3
images:
  base_image:
    name: quay.io/centos/centos:stream9
dependencies:
  ansible_core:
    package_pip: ansible-core==2.18.6
  ansible_runner:
    package_pip: ansible-runner
  galaxy: requirements.yml
  python: requirements.txt
  system: bindep.txt
ansible-builder build -t registry.example.com/ee-platform:1.8.0 -f execution-environment.yml
podman run --rm registry.example.com/ee-platform:1.8.0 ansible-galaxy collection list
trivy image registry.example.com/ee-platform:1.8.0

Then run the Molecule or smoke tests with the new image before pushing. Tag immutably (1.8.0, plus the Git SHA), never deploy latest, and roll the new tag through dev and staging job templates first.

All Ansible questions Roadmap: Ansible

More on Testing, CI/CD and Quality