2 Commits

Author SHA1 Message Date
unkin-agent bd126a0d1e Slim networkctl fact (#576)
The networkctl fact dumps every raw `networkctl --json=short` field, route and interface (including CNI veths), with addresses as byte arrays, pushing facter past its 4096 fact value limit.

- skip links networkd does not manage
- keep only state, type, MTU and config file fields per link
- render MAC and IP addresses as strings, drop routes and empty dropins
- return nil when no managed links exist

Reviewed-on: #576
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-15 18:55:12 +11:00
unkin-agent efe15ec078 Add networkctl fact (#573)
Hosts running systemd-networkd expose link, address, route and DNS state only through `networkctl`, so none of it is visible in PuppetDB for querying or reporting.

- add `networkctl` fact from `networkctl --json=short`, keyed by interface name
- confine to Linux hosts with `networkctl` and a running networkd (`/run/systemd/netif`)
- return nil on missing output or parse failure so puppet runs never break

Reviewed-on: #573
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-15 18:35:20 +11:00