Raise netbox API pagination limit so that all devices are included.
This commit is contained in:
@@ -10,7 +10,7 @@ echo "# generated by $0 at $(date)"
|
|||||||
echo
|
echo
|
||||||
cat dhcpd.conf.head
|
cat dhcpd.conf.head
|
||||||
|
|
||||||
do_curl "https://${NETBOX}/api/ipam/ip-addresses/" | \
|
do_curl "https://${NETBOX}/api/ipam/ip-addresses/?limit=10000" | \
|
||||||
jq -r '.results[] | .assigned_object.device.name + .assigned_object.virtual_machine.name + " " + (.address / "/")[0] + " " + .assigned_object.url' |
|
jq -r '.results[] | .assigned_object.device.name + .assigned_object.virtual_machine.name + " " + (.address / "/")[0] + " " + .assigned_object.url' |
|
||||||
while read name ip owner
|
while read name ip owner
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
RPZ_FILE=/var/unbound/db/local.rpz
|
RPZ_FILE=/var/unbound/db/local.rpz
|
||||||
|
|
||||||
curl -s -k -H "Authorization: Token ${TOKEN}" -X GET "https://${NETBOX}/api/ipam/ip-addresses/" | \
|
curl -s -k -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 + "."' | \
|
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}
|
tee ${RPZ_FILE}
|
||||||
|
|||||||
Reference in New Issue
Block a user