SRE

Ansible Playbook for 50 Servers β€” Configure Everything in One Run

10min for 50 servers vs 100hr manual SSHDevOps & Cloud3 min read

Key Takeaway

The Ansible skill generates complete playbooks for server configuration, application deployment, and infrastructure management. Describe what you need across your fleet, get idempotent, tested playbooks that configure 50 servers as easily as 1.

The Problem

You have 50 servers that need:

  • Updated packages and security patches
  • Nginx installed and configured
  • SSL certificates from Let's Encrypt
  • Firewall rules (UFW)
  • Fail2ban for SSH protection
  • Monitoring agent (node_exporter)
  • Application deployed from Git
  • Log rotation configured
  • Cron jobs set up

Doing this manually: SSH into each server. Run commands. Copy config files. Hope you didn't forget a step. Hope you did the same thing on server 37 as server 1. Hope nobody makes a change that drifts from the baseline.

One server: 2 hours. Fifty servers: 100 hours (4+ days). And it's never consistent.

The Solution

The Ansible skill generates complete playbooks with roles, handlers, templates, and variables. Run once, configure everything. Run again, nothing changes (idempotent). Add a server, run again, only the new server gets configured.

The Process

View details
You: Create an Ansible playbook to configure web servers:
- Ubuntu 22.04 base
- Nginx with SSL (Let's Encrypt)
- UFW firewall (only 22, 80, 443)
- Fail2ban for SSH
- Node exporter for Prometheus monitoring
- Deploy a Node.js app from our GitLab repo
- Log rotation for app logs

The agent generates a complete Ansible project structure:

View details
ansible/
β”œβ”€β”€ inventory/
β”‚   β”œβ”€β”€ production.yml
β”‚   └── staging.yml
β”œβ”€β”€ playbooks/
β”‚   └── webservers.yml
β”œβ”€β”€ roles/
β”‚   β”œβ”€β”€ base/          # Updates, packages, users
β”‚   β”œβ”€β”€ nginx/         # Nginx + SSL
β”‚   β”œβ”€β”€ firewall/      # UFW rules
β”‚   β”œβ”€β”€ fail2ban/      # SSH protection
β”‚   β”œβ”€β”€ monitoring/    # Node exporter
β”‚   β”œβ”€β”€ app-deploy/    # Git clone + PM2
β”‚   └── logrotate/     # Log rotation
β”œβ”€β”€ group_vars/
β”‚   β”œβ”€β”€ all.yml
β”‚   └── webservers.yml
└── ansible.cfg

Each role is fully idempotent with handlers for service restarts, templates for config files, and proper variable separation. Running it against 50 servers takes 10 minutes.

The Results

MetricManual SSHAnsible via AI Agent
Time (50 servers)100+ hours10 minutes (after playbook)
ConsistencyNever (human error)100% (idempotent)
New server onboarding2 hours manualansible-playbook -l new_server
Drift detectionNoneRun playbook, see changes
DocumentationConfluence page nobody readsThe playbook IS documentation
RollbackPraygit revert + re-run

Setup on MrChief

yamlShow code
skills:
  - ansible
  - devops
ansibleconfiguration-managementautomationserver-provisioningidempotent

Want results like these?

Start free with your own AI team. No credit card required.

Ansible Playbook for 50 Servers β€” Configure Everything in One Run β€” Mr.Chief