DOCFIX-149: OPNsense config.xml template + tested renderer
Real design work, researched before drafting: fetched OPNsense's own actual
shipped config.xml.sample and its Route.xml static-routes model before
writing anything.

opentofu/templates/opnsense-config.xml.tmpl: {{TOKEN}}-parameterized (reuses
this repo's existing clientdocs convention), covering interfaces/gateway/
staticroutes/DNS/NTP and D-107-shaped firewall rules (default-deny WAN
egress except NTP + the per-DC mirror's upstream sync). The real sample
fetch directly confirmed last turn's audit finding with an actual example:
it ships literal placeholder device names inside each interface's own <if>
block, proving LAN/WAN role assignment really is that explicit per-block
mapping, not declaration order.

scripts/opnsense-render-config.sh: the renderer. Needs no external tool
(unlike every other opnsense-* script this session), so it's tested
END-TO-END, not just guard clauses -- 8/8, including well-formed-XML
validation. The harness caught a real bug before it shipped: the token
HOSTNAME collides with bash's own built-in $HOSTNAME variable (unset
doesn't actually clear it), silently passing a test that should have
failed. Renamed to OPNSENSE_HOSTNAME throughout.

opentofu/templates/README.md's token legend marks exactly which values are
real (NTP pool default, D-106 naming) vs. pending Stage 0 ratification
(D-100/D-101/D-107) vs. only measurable on a real boot (vtnetN assignment)
vs. a security requirement (root password hash must be freshly generated,
never the stock sample's own shipped default).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrcJx8TUar7pYAvpGJw57A
1 parent 96ecbad commit 3981a74cbbb3f7e5fecf580bda6fd74868897a02
@JANeumatrix JANeumatrix authored 4 hours ago
Showing 9 changed files
View
docs/changelog-20260709-opnsense-config-design.md 0 → 100644
View
docs/dc-dc-deployment-workflow.md
View
docs/session-ledger.md
View
opentofu/README.md
View
opentofu/templates/README.md 0 → 100644
View
opentofu/templates/opnsense-config.xml.tmpl 0 → 100644
View
scripts/opnsense-render-config.sh 0 → 100644
View
scripts/repo_lint.py
View
tests/opnsense-render-config/run-tests.sh 0 → 100644