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.
More on Project Structure and Design
What does a production Ansible repository look like?BeginnerMonorepo or separate repos for roles? How do you decide?IntermediateHow do you structure inventories for dev, stage and prod?BeginnerHow do you prevent someone from running a playbook against production by accident?IntermediateWhat does "thin playbooks, fat roles" mean?IntermediateWhat makes a well-designed role?Intermediate