← All posts

Plan before you apply

Infrastructure as code only makes the lab safer if you actually read the plan. Here’s the habit that stuck for me.
November 24, 2026·5 min read#opentofu#habits
OpenTofu (the open-source fork of Terraform) splits every change in two: a plan that shows what will change, and an apply that does it. The plan is the safety net, but only if somebody reads it. For a long time that somebody was “future me”, and future me was busy.
So now, before I run a change, I write down what I expect it to do: which things change, and how many get added or destroyed. That’s my accept list. Then I read the plan against it.
  • If it matches, I apply it.
  • If it changes anything I didn’t list, I stop. Never “most of it”.
  • If it wants to destroy something I didn’t expect, I stop twice.
I also keep changes narrow. A plan that touches one firewall rule shouldn’t re-plan the whole lab. Small plans are easier to read, quicker to run and much harder to get wrong.
Semaphore runs the plans for me, so there’s a queue and a history of every run. When something breaks, I can see what changed instead of guessing.
And I keep plan and apply apart in time. Plan, read, then confirm. That minute in between has saved me more evenings than any tool.
🏠
Written from my homelab. Everything here runs in my own rack first. Spotted a mistake, or run something better? Tell me.