When is Ansible the wrong tool?
IntermediateProductionArchitecture Decisions and Tool Comparisons
Answer
- Long-lived cloud infrastructure with many dependencies: Terraform's plan and state are a better fit.
- Continuous enforcement every few minutes on huge fleets: an agent-based tool or immutable images.
- In-cluster Kubernetes resources: GitOps controllers.
- Real-time or high-frequency operations: Ansible's per-run overhead is seconds, not milliseconds.
- Complex application logic: if the playbook is mostly
set_factand nested loops, write a Python script or a custom module. - Building container images: a Dockerfile is simpler and cacheable.
Knowing these limits is a sign of experience. Interviewers like candidates who say "I would not use Ansible for that" with a reason.
More on Architecture Decisions and Tool Comparisons
Ansible or Terraform: where do you draw the line?BeginnerHow does Ansible compare with Puppet, Chef and Salt?IntermediateWhy use Ansible instead of shell scripts?BeginnerWhere does Ansible fit once you run Kubernetes?Intermediatecloud-init or Ansible for first boot configuration?IntermediateWhen would you use AWS Systems Manager instead of, or together with, Ansible?Intermediate