A pipeline step must fail if a run had any `changed` tasks (drift detection).
IntermediateScenarioPerformance, Testing and CI/CD
Answer
Situation read → Use Ansible as a drift checker.
What I'd do → Run in check mode and parse the recap, or use the JSON callback.
ANSIBLE_STDOUT_CALLBACK=json ansible-playbook site.yml --check > out.json
jq '[.stats[] | .changed] | add' out.json
Fail when the sum is greater than zero.
Why → In check mode changed means "would change", which is drift.
Interview tip → Schedule it in AWX nightly with notifications.
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