
Ansible for DevOps: Automate Server Configuration in 30 Minutes (Not 30 Days)
You have 15 servers. Each one needs the same packages, the same users, the same firewall rules, the same monitoring agent, and the same application configuration. You can SSH into each one and run the same commands 15 times. Or you can write an Ansible playbook once and apply it to all 15 in parallel. That's Ansible in one sentence: define what your servers should look like, and Ansible makes them look like that. Why Ansible Over Shell Scripts Shell scripts work. Until they don't. # This shell script installs nginx... maybe apt-get update apt-get install -y nginx systemctl start nginx systemctl enable nginx Problems: Not idempotent. Run it twice and apt-get install shows warnings. Run it after a partial failure and you might be in an unknown state. No error handling. If apt-get update fails, the script continues and tries to install from stale package lists. OS-specific. This script only works on Debian/Ubuntu. CentOS uses yum . Alpine uses apk . No inventory. Which servers to run this
Continue reading on Dev.to
Opens in a new tab

