Tutorials DevOps & Cloud Architect Mastery
Ansible: Configuration management vs Infrastructure provision
On this page
Ansible & Configuration Management
Terraform builds the "House" (VMs, Networks). Ansible paints the "Walls" and installs the "Furniture" (Software, Configs, Users). It is the premier Configuration Management tool.
1. Agentless Architecture
Unlike other tools (Chef/Puppet), Ansible is Agentless. You don't need to install anything on the target servers. It just needs **SSH** access. This makes it incredibly easy to start using even on legacy servers.
2. Playbooks & Roles
Ansible uses YAML **Playbooks**. A playbook describes the desired state of a server (e.g., "Nginx should be installed and running"). **Roles** allow you to bundle tasks, files, and templates into reusable packages (e.g., a "Secure-WebServer" role).
4. Interview Mastery
Q: "Is Ansible Immutable or Mutable?"
Architect Answer: "Ansible is traditionally **Mutable**. It modifies existing servers in place. Modern best practices often combine Ansible with **Packer** to create **Immutable Images**. We use Ansible to configure a VM, then Packer 'Saves' that VM as an image (AMI), and then we deploy that fixed image using Terraform. This gives you the power of Ansible with the reliability of Immutable Infrastructure."