Interview Prep/Ansible/Project Structure and Design

Pets versus cattle: where does Ansible fit?

IntermediateProductionProject Structure and Design
Answer

Ansible shines for long-lived "pets" such as databases, bare metal, network gear and legacy VMs, where in-place configuration is the model. For stateless "cattle" the better pattern is immutable: build an image, deploy it, replace instead of patch.

In many shops Ansible does both: it builds the images (Packer), bootstraps hosts, and then configures the stateful tier. Choose mutable configuration deliberately where replacement is expensive, and keep those hosts few and well documented.

All Ansible questions Roadmap: Ansible

More on Project Structure and Design