Update for new netbox setup.

This commit is contained in:
2024-01-18 16:19:43 +00:00
parent 9c1de65e4c
commit a68b475115
3 changed files with 4 additions and 4 deletions

View File

@@ -4,6 +4,6 @@
RPZ_FILE=/var/unbound/db/local.rpz
curl -s -k -H "Authorization: Token ${TOKEN}" -X GET "https://${NETBOX}/api/ipam/ip-addresses/?limit=10000" | \
curl -s -k -H "Host: netbox.v.paler.net" -H "Authorization: Token ${TOKEN}" -X GET "https://${NETBOX}/api/ipam/ip-addresses/?limit=10000" | \
jq -r '.results[] | (.address / "/")[0] as $addr | (.assigned_object.device.name + .assigned_object.virtual_machine.name + ".home.paler.net") as $name | ($addr | split(".") | reverse | join(".") + ".in-addr.arpa") as $rev | $name + " A " + $addr, $rev + " PTR " + $name + "."' | \
tee ${RPZ_FILE}