ADR-002 / Decision record

A separate root per environment, not workspaces

Four directories, four state files, four tokens. Applying to the wrong environment takes more than one typo.

Context
Four environments (platform, lab, prod, range) share one node and one toolchain.
Decision
Each environment has its own OpenTofu root, state file, pool-scoped API token, Ansible inventory and secrets. The roots are byte-identical apart from one tfvars file, and CI enforces that.
Why
tofu workspace select prod is one typo away from applying to the wrong environment. Separate directories give separate credentials, separate state, and a visible path in every command.
Trade-off
Four copies of the root have to stay identical. Doing that by hand would be risky, so an env-drift check in CI fails any PR that lets them diverge.

Notes

The drift check is what makes “tested in lab” mean something. If the lab and prod roots could differ in more than their variables, a successful lab apply would only prove that lab works.

Separate roots also give each environment its own VMID band (1000s, 2000s, 3000s, 4000s), so you can read the environment from a guest’s ID.