feat: NetBox IP/interface facts with offline cache #506
Open
unkinben
wants to merge 1 commits from
benvin/netbox-facts into develop
pull from: benvin/netbox-facts
merge into: unkin:develop
unkin:develop
unkin:benvin/wgvpn-role
unkin:benvin/consul-dns-k8s
unkin:benvin/consul-clients-k8s
unkin:benvin/consul-mesh-gateway
unkin:benvin/consul-server-tls-fed
unkin:benvin/halb-drop-grafana
unkin:benvin/journald-explicit-port
unkin:benvin/certmanager-k8s-auth
unkin:benvin/openbao-plugin-socket-tmpfiles
unkin:benvin/rke2_upgrade
unkin:benvin/artifactapi_repos
unkin:benvin/backend_dovecot
unkin:benvin/exporter_ip_loopback
unkin:neoloc/ceph
unkin:neoloc/mpls_mpbgp_rr
unkin:neoloc/firewall
unkin:neoloc/includegroups
unkin:neoloc/exportarr
unkin:neoloc/authproxy
unkin:neoloc/openldap
unkin:neoloc/puppetdb_ssl
unkin:master
1 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
fe3c1a1410 |
feat: add NetBox IP/interface facts with offline cache
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful
Add a structured `netbox` fact that reads this node's IP/interface data from NetBox, and profiles::netbox::facts to seed its credentials. - netbox fact: queries NetBox (devices + VMs) by fqdn/hostname, emits interfaces (name, mac, ips, primary) and primary_ip. - Caches every success to /var/cache/puppet-netbox/facts.json (0600). On any failure (short timeouts, DNS, non-200, parse) it serves the cached payload with cached=true; static IPs never change so stale is always safe. A never-cached host returns nothing; the fact never raises. - profiles::netbox::facts: inert until $api_token is set; writes the root-only token/url files and the cache dir. Confined off (no-op) on hosts without the token. Included from profiles::base. Claude-Session: https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT |