Agent Wranglers

Servers Required

Rebuild any server from code

Keep everything needed to rebuild each server in code, so one command builds a fresh one. Prove it on a new machine in the quarterly restore drill.

How to do it

The single server is the place where hand-made setup piles up. Write down every package, setting, user, timer and firewall rule in code. Keep the data apart and restore it as in the restore runbook. Time the drill from an empty machine to a passing health check, against the service's recovery time objective.

Example

# Drill: a fresh machine, the same code, then the health check
tofu apply -var="name=shop-drill"
ansible-playbook -i shop-drill.example.com, site.yml
./restore-latest-backup.sh shop-drill.example.com
curl -fsS https://shop-drill.example.com/health

How to check

The last rebuild drill is under 3 months old. It built a working server from code and backups within the recovery time objective, without logging in to fix anything.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers infrastructure playbook: https://agentwranglers.se/playbook/infrastructure/servers/rebuild-from-scratch.