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

How do you measure the health of an Ansible codebase?

BeginnerProductionTesting, CI/CD and Quality
Answer

A few numbers we track over time:

  • Lint: current profile level and number of noqa lines (should trend down).
  • Test coverage: share of roles with a Molecule scenario that passes idempotence.
  • Drift: hosts reporting changed on a scheduled check-mode run.
  • Run health: failure rate and duration per job template, from AWX or CI.
  • Freshness: age of pinned collection versions and of the ansible-core version.
  • Risky patterns: count of shell/command tasks and of ignore_errors: true.

None of these need a fancy tool; a weekly CI job that greps and reports them is enough to show whether the code is getting better or worse.

All Ansible questions Roadmap: Ansible

More on Testing, CI/CD and Quality