Interview Prep/Ansible/Project Structure and Design

How do you detect and handle configuration drift?

AdvancedProductionProject Structure and Design
Answer

Detect: run the playbooks regularly in --check --diff mode from AWX or CI on a schedule, and report hosts with changed > 0. Because check mode cannot predict everything (command/shell are skipped), pair it with idempotent modules and sanity assertions.

Handle: decide per case whether to enforce (apply the playbook on schedule) or alert and investigate. Enforcing nightly is safe only when playbooks are idempotent and tested. We also lock down interactive access and make changes only through Git, because drift is mostly a process problem rather than a tooling one.

All Ansible questions Roadmap: Ansible

More on Project Structure and Design