Interview Prep/Ansible/Architecture Decisions and Tool Comparisons

Why use Ansible instead of shell scripts?

BeginnerProductionArchitecture Decisions and Tool Comparisons
Answer
  • Idempotence: modules check state before changing it, so re-running is safe. Scripts usually are not.
  • Inventory and parallelism: target groups of hosts with forks built in, instead of hand-written SSH loops.
  • Error handling: per-host failure tracking, serial, max_fail_percentage, retries.
  • Dry runs: --check --diff shows what would change.
  • Readability and reuse: roles, variables per environment, templates.
  • Secrets: Vault and credential plugins instead of passwords in scripts.

Shell is still the right tool for small, local, one-off tasks and inside containers. Once a script runs on more than a few servers or needs to be re-run safely, move it to Ansible.

All Ansible questions Roadmap: Ansible

More on Architecture Decisions and Tool Comparisons