Ansible
The most widely used configuration management and automation tool — defines server configuration as code and applies it consistently across fleets of machines.
Ansible is the leading open-source configuration management, application deployment, and infrastructure automation tool. It uses simple YAML-based playbooks to define the desired state of servers — installed packages, file contents, running services, user accounts — and applies those playbooks idempotently across any number of machines over SSH, with no agent required on the target. Ansible is used for server provisioning, application deployment, and orchestrating complex multi-step operations. It is the most common configuration management tool in job postings, alongside Terraform for infrastructure provisioning.
Typical time to job-readiness: ~4 weeks.
Learning Ansible
Beginner
Install Ansible and run your first playbook against a local Docker container or VM. Learn the core concepts: inventory (which hosts to target), playbooks (ordered list of plays), tasks (what to do), and modules (the built-in actions like apt, copy, service, user). Understand idempotency — why running the same playbook twice should produce the same result.
Intermediate
Roles for organizing reusable playbook components, variables and Jinja2 templating, Ansible Vault for encrypting secrets, and dynamic inventory from cloud providers (AWS, GCP). Learn how to write handlers (tasks that only run on change) and use conditionals and loops.
Advanced
Ansible Galaxy for sharing roles, AWX/Ansible Tower for enterprise UI and RBAC, testing playbooks with Molecule, and designing playbooks for zero-downtime rolling deployments. DevOps interviews often include a practical: 'Write a playbook to configure a web server' — focus on idempotency and clear variable naming.
Key concepts
- Agentless: Ansible connects via SSH — no daemon to install or maintain on target machines
- Idempotency: running the same playbook twice produces the same result; tasks only change what needs changing
- Playbooks: YAML files defining a sequence of plays, each targeting a group of hosts with a list of tasks
- Modules: the built-in actions (apt, yum, copy, service, user, command) that do the actual work
- Roles: organized, reusable collections of tasks, variables, templates, and handlers
- Inventory: a list of target hosts, organized into groups; can be static YAML or dynamic from cloud APIs
Common interview topics
- What is idempotency in Ansible and why does it matter
- Explain the structure of an Ansible playbook
- How do you manage secrets in Ansible
- What is the difference between a task, a role, and a playbook
- How would you write a playbook to install and configure Nginx