← Back to Projects
🤖

From Zero to Cloud: Ansible + Terraform Multi-Server Automation

5 assignments. 4 cloud VMs. Idempotent deployments. Production-grade Ansible Roles.

PlatformAWS (switched from Azure due to quota limits)
ToolsAnsible · Terraform · Nginx · Jinja2 · Python venv
Key ConceptIdempotent Infrastructure Automation
Read on MediumView Article →

The Moment Everything Clicked

What Automation Feels Like

I had 4 servers running on AWS. I typed one command:

ansible all -i inventory.ini -m ping → All 4 servers responded. Simultaneously. In seconds. ansible web -i inventory.ini -m apt -a "name=nginx state=present" --become → Nginx installed itself on 2 servers at the same time. → Without touching either server. Without clicking anything. That feeling — watching automation work for the first time — is something no tutorial can fully prepare you for.
A1
Professional Ansible Workstation — Python venv, VS Code, SSH keys, Git hooks, pre-commit validation, ansible.cfg
A2
4 Cloud VMs with Terraform + Fleet Commands — provisioned 4 AWS VMs, configured passwordless SSH, ran fleet-wide ad-hoc commands across web/app/db groups
A3
Multi-Play Ansible Playbook — installed Nginx, deployed static website using copy module, verified HTTP 200 automatically
A4
Terraform + Ansible Combined — spun up infrastructure with Terraform, deployed Mini Finance website with Ansible, verified end-to-end in browser
A5
Production-Grade Ansible Roles — roles/common, roles/nginx (Jinja2 templates), roles/epicbook deployment, idempotent runs, group variables

What I Learned

Automation Is Not Laziness — It Is Reliability at Scale

One command configuring 4 servers identically is not cutting corners. It is the elimination of human error at the moment most likely to introduce it.

Idempotency Is the Gold Standard

When I ran the playbook a second time, almost everything showed "ok" instead of "changed." That means the system only changes what needs to change — exactly how production deployments must work.

Clean Structure Is Non-Negotiable in Production

Splitting responsibilities into roles (common, nginx, epicbook) with their own tasks, handlers, and templates is the difference between a script and a system.

Azure Quota Limits Are a Real-World Problem

Azure blocked 4 VMs due to public IP limits. Instead of stopping, I switched to AWS. Real engineers adapt when tools fail.

AnsibleTerraformAWSNginxJinja2Python venvSSHIdempotencyAnsible Roles
Read Full Article on Medium →