RouterOS 003: Terraform trees per device + tofu-controller objects #65

Closed
opened 2026-11-14 01:41:03 +00:00 by ginjiruu · 1 comment
Owner

Part of #43

Refs: lab/iac#45
Migrated from router-as-code tracker 003 (docs/routeros/tracker in this repo history). Research notes: docs/routeros/notes/.

Where the config of record lives. Follow the pattern already running for
vault/harbor/kanidm: HCL in the iac repo under router/<device>/, Flux
Terraform objects in flux-clusters clusters/mini/iac/ (see
vault-config.yaml for the shape: approvePlan: auto, 1h interval,
storeReadablePlan: human, varsFrom Secret, GitRepository iac).

Scope

  • Three workspaces (state per device): router/rb5009-a/,
    router/rb5009-b/, router/crs309/. Provider blocks per device:
    hosturl = "https://<mgmt-ip>", username from vars, password from
    Secret, insecure or ca_certificate pinned to the bootstrap cert,
    routeros_version pinned.
  • required_providers pin terraform-routeros/routeros to a tested version;
    provider upgrades are their own MR, with sim (#001) first.
  • Terraform objects: rb5009-a, rb5009-b, crs309, interval 1h — the controller's
    periodic plan is the drift detector. Ordering: crs309 depends_on nothing;
    routers plan clean against it (interlink is the CRS309, see iac#44 port map).
  • Secrets via SOPS-encrypted vars consumed by the controller
    (see #006).

Done when

  • Full lab config in git, controller-applied, plan clean on all three for a
    week (iac#45 criterion).
Part of #43 Refs: lab/iac#45 Migrated from router-as-code tracker 003 (docs/routeros/tracker in this repo history). Research notes: docs/routeros/notes/. Where the config of record lives. Follow the pattern already running for vault/harbor/kanidm: HCL in the `iac` repo under `router/<device>/`, Flux `Terraform` objects in flux-clusters `clusters/mini/iac/` (see `vault-config.yaml` for the shape: `approvePlan: auto`, 1h interval, `storeReadablePlan: human`, `varsFrom` Secret, GitRepository `iac`). ## Scope - Three workspaces (state per device): `router/rb5009-a/`, `router/rb5009-b/`, `router/crs309/`. Provider blocks per device: `hosturl = "https://<mgmt-ip>"`, `username` from vars, `password` from Secret, `insecure` or `ca_certificate` pinned to the bootstrap cert, `routeros_version` pinned. - `required_providers` pin `terraform-routeros/routeros` to a tested version; provider upgrades are their own MR, with sim (#001) first. - Terraform objects: rb5009-a, rb5009-b, crs309, interval 1h — the controller's periodic plan is the drift detector. Ordering: crs309 depends_on nothing; routers plan clean against it (interlink is the CRS309, see iac#44 port map). - Secrets via SOPS-encrypted vars consumed by the controller (see #006). ## Done when - Full lab config in git, controller-applied, `plan` clean on all three for a week (iac#45 criterion).
Author
Owner

Lab verification: roots rb5009-a/rb5009-b both plan pure creates (168 add / 0 change / 0 destroy) against boot-state lab routers via REST; guard OK; details in PR #111 comment. crs309 remains untestable in lab (labsw is a Linux bridge), bench-scoped.

Lab verification: roots rb5009-a/rb5009-b both plan pure creates (168 add / 0 change / 0 destroy) against boot-state lab routers via REST; guard OK; details in PR #111 comment. crs309 remains untestable in lab (labsw is a Linux bridge), bench-scoped.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/iac#65
No description provided.