iac_tls: gather the network facts and renew a self-signed certificate without them #75

Merged
kevinheyer merged 1 commit from tls-own-facts into main 2026-11-25 10:29:19 +01:00
Member

Refs iac-core#58 (the issue stays open until verified on a guest).

iac_tls gathers the network facts itself, so the names of the self-signed certificate contain the IP of the guest even when the play started without iproute2. A self-signed certificate (subject = issuer) that lacks a current name or the IP is made again from the same key, and the services of tls.reload are reloaded. The certificate of a CA stays.

Merge order: this PR, then move v2, then the app PRs iac-monitoring and iac-ciso-assistant (branch tls-own-facts) that drop their own setup task.

Tested: tools/lint.sh; check-all-apps.sh --sample (5 of 5); dev container of iac-monitoring: certificate names the IP, second run changes only instance.json, a self-signed certificate with only 127.0.0.1 is renewed with the same key, a certificate of a test CA keeps its fingerprint.
Not tested: a VM image, the full check-all-apps.sh run, a real guest.

🤖 Generated with Claude Code

https://claude.ai/code/session_014Px55FVUdXiuWr642SZTHK

Refs iac-core#58 (the issue stays open until verified on a guest). `iac_tls` gathers the network facts itself, so the names of the self-signed certificate contain the IP of the guest even when the play started without iproute2. A self-signed certificate (subject = issuer) that lacks a current name or the IP is made again from the same key, and the services of `tls.reload` are reloaded. The certificate of a CA stays. **Merge order:** this PR, then move `v2`, then the app PRs iac-monitoring and iac-ciso-assistant (branch `tls-own-facts`) that drop their own `setup` task. Tested: `tools/lint.sh`; `check-all-apps.sh --sample` (5 of 5); dev container of iac-monitoring: certificate names the IP, second run changes only instance.json, a self-signed certificate with only 127.0.0.1 is renewed with the same key, a certificate of a test CA keeps its fingerprint. Not tested: a VM image, the full `check-all-apps.sh` run, a real guest. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014Px55FVUdXiuWr642SZTHK
iac_tls: gather the network facts and renew a self-signed certificate without them
All checks were successful
/ lint (push) Successful in 22s
/ lint (pull_request) Successful in 17s
beac91ffd0
The names of the self-signed certificate come from the facts of the
guest. At the start of a play a minimal image has no iproute2, so the
facts lack the address and the certificate named only 127.0.0.1 – and as
it is made once, it stayed wrong. Apps worked around it with their own
setup task.

iac_tls now gathers the network facts itself. A self-signed certificate
(subject = issuer) that lacks one of the current names is made again
from the same key and the services of "tls": {"reload": [...]} are
reloaded; the certificate of a CA stays.

Tested: tools/lint.sh; dev container of iac-monitoring without its own
setup task: the certificate names the IP, the second run changes only
instance.json; a self-signed certificate with 127.0.0.1 only is renewed
(same key, IP in the SAN), then a run changes nothing; a certificate
signed by a test CA keeps its fingerprint. Not tested: a VM image.
Sign in to join this conversation.
No description provided.