tofu: rename from terraform, state in its own bucket, Loki buckets
All checks were successful
nixos / nixos (push) Successful in 34s

The infrastructure is applied with OpenTofu; name it so. terraform/
becomes tofu/, the files end in .tofu (OpenTofu 1.8+ prefers them), the
local variables file is secrets.auto.tfvars, and both servers carry
managed_by=opentofu (an in-place label change).

The state moved to new buckets asxpio-tofu-main/-repl, key
tofu/state/tofu.tfstate, with `tofu init -migrate-state`; a plan against
it shows no changes. The old asxpio-terraform-* buckets stay, renamed
in the config with moved blocks, until the new state has been used for
a while.

asxpio-loki-main, created by hand, is adopted with an import block, and
a new asxpio-loki-repl in fsn1 receives it in the daily replica, which
now also copies the new state bucket instead of the old one.

What keeps the Terraform name is OpenTofu's own: the `terraform {}`
block and .terraform.lock.hcl.

Assisted-by: Claude:opus-5-5
This commit is contained in:
Sergei Poljanski 2026-11-17 09:42:53 +04:00
commit 796331815d
Signed by: asxpi
GPG key ID: 4F8851660FA4121B

View file

@ -19,8 +19,8 @@ Both are reachable for administration only over WireGuard
## Layout
- `terraform/`: servers, network, firewalls, DNS, object storage buckets.
Applied by hand; see `terraform/README.md`.
- `tofu/`: servers, network, firewalls, DNS, object storage buckets (OpenTofu).
Applied by hand; see `tofu/README.md`.
- `ansible/site.yaml`: everything the pipeline manages (see below).
- `ansible/playbooks/`: host bootstrap, run by hand.
- `.forgejo/workflows/deploy.yaml`: the pipeline.
@ -140,7 +140,7 @@ The password is `vault_restic_password` in the vault. Keep a copy
outside the servers and this repo's CI: without it nothing can be read.
`s3_replicate` copies `asxpio-backups-main` (minus `restic/`),
`asxpio-terraform-main` and `k8s-asxpio-main` to their fsn1 twins daily
`asxpio-tofu-main`, `asxpio-loki-main` and `k8s-asxpio-main` to their fsn1 twins daily
around 06:10 UTC. A run that would delete over 1000 objects stops and
mails instead.