RouterOS: in-graph arm + on-box self-judging rollback timer #74
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/iac#74
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #43
Refs: #45, #46, #63 (CHR sim), #65 (controller objects), #66 (import)
Revised 2026-11-13 for air-gapped use with no outside orchestration. Replaces the first draft's cluster-side confirmer.
Constraints
api/v1alpha2, main) has no pre- or post-apply hooks.healthChecksare post-apply TCP/HTTP probes that only mark the object not Ready.runnerPodTemplate.initContainersruns on every reconcile, including no-op plans. Neither can arm or roll back.Design: hooks inside the Terraform graph, decision on the router
terraform_data.arm,triggers_replace= hash of the rendered device config, so it runs only when the config changes. local-exec through REST: save a backuppre-<hash>, then create a script and a schedulerrollback-<hash>with start-time now + N.lifecycle.preconditionreads therouteros_filesdata source and fails ifrolled-back-<hash>exists. This is the re-apply loop guard.depends_on = [terraform_data.arm]./tool netwatchstatus (k8s API VIP, a node, internal DNS, the peer router, the WAN or local anchor).rolled-back-<hash>, then/system backup load.terraform_data.confirmdepends on the module and deletes the scheduler once its own REST probe succeeds.Nothing off the router has to answer. It also works when the cluster is the thing that's down.
Open, verify in CHR sim (#63)
backup loadkeeps the same.ids. Mitigation if not: provider import resolves by name or field (#66).rollback-*scheduler.provider_installationmirror.RouterOS: armed rollback timer + cluster-confirmed applies (commit-confirm)to RouterOS: in-graph arm + on-box self-judging rollback timerADR-0009: a cert rotation is a normal Terraform change, so it is armed like any other apply. A bad cert or binding that breaks REST stops the cluster confirming and rolls back on the router's timer.