This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Printers

Printer DNS and network access in dc1

This project owns printer DNS declarations and network access. The DNS root publishes the canonical declaration. The service configuration permits Wi-Fi access to printer1. The MikroTik accounts root owns its RouterOS account and Vault credential. Printer firmware and print queues are unmanaged.

The existing printer records and firewall rule have been adopted into this project’s state. The migration receipt records their preserved identities and the owning validation commands.

The diagram source describes the checked-in topology. The printer connects to the router over the wired LAN; its DNS name resolves directly to the printer. Wi-Fi access uses the printer-only firewall exception.

Printer networkPrinter network

1 - Docs

1.1 - Printer1 state migration

Completed on 2026-11-07. The existing DNS records and firewall rule are now owned by the printers project, with unchanged live identities and matches. The deployment receipt records the operations and verification evidence. No printer record or firewall rule was destroyed or recreated.

  • //infra/printers/dns owns both printer DNS views through the printers AppRole’s tf_backend/dns backend.
  • //infra/printers/tf owns the Wi-Fi exception through its tf_backend/tf backend and dedicated RouterOS credential.
  • //infra/mikrotik/accounts owns the printers account and generated Vault credential, using the operator-supplied MikroTik administrator secret.
  • //infra/mikrotik/tf retains router, switch and bare-metal DNS records. It no longer owns printer DNS. The former firewall backend has no bindings.

The MikroTik AppRole no longer has the ingress-secret read policy. The printers identity cannot read the administrator credential. Do not restore old deployment jobs or run the former source revision against its old state; that source would attempt to recreate objects whose bindings have moved.

With explicit authority for live review, use the normal text plans:

bazel run //infra/printers/dns:tf.plan
bazel run //infra/printers/tf:tf.plan
bazel run //infra/mikrotik/accounts:tf.plan
bazel run //infra/mikrotik/dns:tf.plan

All should report no resource changes. Check the existing firewall rule still precedes the enabled terminal forward drop. Its place_before attribute is creation-only and cannot be reconstructed by import; source ignores updates to that attribute while retaining guarded insertion for newly created rules.

A rollback requires separate authority and a reviewed plan. Freeze both writers, restore declarations in the intended owner, remove only the exact current bindings, and import the verified existing objects into that owner’s backend. Never delete live records or the rule merely to move ownership, and never keep two active state bindings for one object. If an import fails, keep writers stopped and restore the binding before allowing an apply.

Use an owning state-only wrapper authenticated by the appropriate owner AppRole; the old firewall backend is still available for controlled recovery. Do not revive an ingress-credential dependency to access it. Its temporary migration target and selector were removed after the empty-state check. Keep credentials in Vault and retain only sanitized summaries of any recovery.

2 - Printer DNS

This DNS-only root manages the canonical printer declaration through the shared DNS module. Printer1 retains printer1.dc1.alwaldend.com, its private IPv4 address, and both dc1 and global DNS views. Public resolution does not provide a route to the printer. Records remain unproxied.

The tf=dns wrapper selects src_infra_printers, the shared DNS provider credentials, and the owner’s tf_backend/dns Vault HTTP backend. It does not use the printers firewall account. DNS management defaults to enabled to preserve the existing records adopted through the completed state transfer. Both views retain their original provider identities.

Run offline formatting, pinned-provider schema validation and declaration checks:

bazel test //infra/printers/dns:tf_tests.fmt_test \
  //infra/printers/dns:tf_tests.validate_test //infra/dns:config_test

Operational targets use //infra/printers/dns:tf.<operation> and require explicit live authority. Expected reconciliation after adoption is no DNS changes.

3 - Printer network access

This root defines the printer1 IPv4 forwarding exception on router1. Clients in 192.168.2.0/24 arriving on Wi-Fi bridge2 may reach the printer through wired bridge1. The destination comes from printer1_a in the canonical declaration. All IPv4 services on that host are included; other wired destinations do not match. The printer needs stable addressing and a return gateway through 192.168.1.1.

The rule precedes the enabled forward drop with comment drop forward. Planning fails unless exactly one such drop matches. The existing rule’s tf[infra/mikrotik/firewall] comment is retained as its deployed identifier, avoiding an incidental router update during state adoption. No router export or unrelated firewall rule is applied. Existing connection tracking handles replies; manual rule reordering requires another order check.

place_before is creation-only in the pinned provider and is not returned by RouterOS on import. Its updates are ignored after creation so adopting an existing rule does not replace it. New rules still use the guarded insertion point; verify actual ordering after adoption or manual firewall changes.

The tf=main wrapper uses the src_infra_printers AppRole and its tf_backend/tf backend. It injects the RouterOS endpoint from shared infra AL configuration and the dedicated mikrotik_username and mikrotik_password fields from secrets/alwaldend.com/vault1/approles/src_infra_mikrotik/printers. The MikroTik accounts root owns account creation and rotation; the printers AppRole has only read access to that secret. Its Vault definition also grants the DNS credentials used independently by the DNS root.

The state transfer is complete; the existing rule retains its provider identity. Operational targets are //infra/printers/tf:tf.<operation> and require explicit live authority.

The shared injection helper supplies MIKROTIK_HOST, MIKROTIK_USER, and MIKROTIK_PASSWORD directly to the default RouterOS provider. DNS retains its separate aliased provider inputs.

bazel test //infra/printers/tf:tf_tests.fmt_test \
  //infra/printers/tf:tf_tests.validate_test

These checks validate formatting and provider schema offline, excluding only the backend. They do not execute the live drop lookup or verify connectivity. After an authorized migration, expect a no-change plan and verify the existing rule still precedes the terminal drop. From a real Wi-Fi client, run:

nslookup printer1.dc1.alwaldend.com 192.168.2.1
curl --connect-timeout 5 --max-time 10 --location --output /dev/null \
  --write-out '%{http_code}\n' http://printer1.dc1.alwaldend.com/

Confirm the declared address resolves and the printer page opens, then submit a test job through its supported print protocol. Retain sanitized acceptance evidence. Routed access does not relay mDNS or AirPrint discovery across subnets.