Skip to content

Latest commit

 

History

History
46 lines (40 loc) · 2.76 KB

applying.md

File metadata and controls

46 lines (40 loc) · 2.76 KB

Applying

Plans and applies execute remotely on the homelab Terrakube (dryvist/iac-platform) via the cloud block in versions.tf — run plain tofu plan / tofu apply and the output streams back. The provider's GitHub token is minted from OpenBao on every run by an ephemeral resource in providers.tf: it never exists on dev machines, in CI config, in any keychain, or in state.

Authentication (zero keychain, zero stored passwords): tofu login "$TF_CLOUD_HOSTNAME" once per machine (the Terrakube API FQDN comes from the environment — see versions.tf; browser → GitHub via dex; requires membership in the org's terrakube-admins team). Token lands in ~/.terraform.d/credentials.tfrc.json. The TF_CLOUD_* coordinates (hostname, org, workspace) are a fleet-wide fact owned by the platform, stored once in OpenBao (secret/platform/terrakube/main) and dynamically generated by the shared nix-devenv helper at direnv allow via the platform AppRole (BAO_ADDR + role/secret ID from the operator's environment) — no manual exports, nothing sensitive committed.

Approval gate (testing phase): tofu apply confirms interactively; UI-triggered runs use Terrakube's native approval-step template. This gate is the TESTING-phase contract only — the end state is full automation, also native: flip the workspace to auto-apply (approval step removed from its template) and drive autonomous runs with Terrakube's scheduler. There is deliberately NO CI plan/apply workflow — the platform's native flows cover both phases (ci-gate.yml still validates offline).

Availability window: the platform is deliberately not-24/7 (its node powers off nightly). If tofu can't reach the hostname, power the node on; never start an apply near the nightly shutdown. Operations details: iac-platform's docs/runbook.md.

Enforcement defaults. Each ruleset's <name>_enforcement variable default is set in variables.tf. Most rulesets default to active. markdown_lint_enforcement, conventions_enforcement, ai_review_enforcement, org_release_freeze_enforcement, and merge_gate_strict_enforcement default to evaluate, which reports results without blocking. org_review_gate_enforcement defaults to disabled. A workspace variable overrides a default. A misbehaving rule can be disabled with -var <name>_enforcement=disabled without a code change.

automation_bypass_app_ids has no default. The branch-write restriction (rulesets-branch-write-restriction.tf) lets only these GitHub Apps create or update a branch other than main. Set it as a Terrakube workspace variable (a list of numeric app IDs) before the first plan. Leaving an app out stops its branch pushes and PR updates on the next apply; add its ID and re-apply.