Page MenuHomePhabricator

Netbox/DNS, browse parents prefixes to set site
Closed, ResolvedPublic

Description

All IPs under 2a02:ec80::/32 are set to belong to esams (eg. included in the wikimedia.org-esams).
While IPs in 2a02:ec80:600::/48 should be for drmrs (eg. wikimedia.org-drmrs)

This is because 2a02:ec80::/32 used to be exclusively for esams, but part of it has now been assigned to drmrs.

However removing the site attribute of 2a02:ec80::/32, causes all the IPs under it to be "site-less".

This is because the script only takes the topmost prefix into account.

Instead it should browse the prefixes tree from the IP upward, and stop at the first site detected. Only falling back to global if there is no match at all.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 732919 had a related patch set uploaded (by Majavah; author: Majavah):

[operations/software/netbox-extras@master] Use most specific prefix for dns record site assignment

https://gerrit.wikimedia.org/r/732919

Change 732919 merged by jenkins-bot:

[operations/software/netbox-extras@master] Use most specific prefix for dns record site assignment

https://gerrit.wikimedia.org/r/732919

Volans claimed this task.

With the fix of the above patch merged I've run the dns.netbox cookbook that has moved over the records to the correct zonefile. I've then removed the 'site' from the 2a02:ec80::/32 container in Netbox as it's now used cross-site and re-run the cookbook in dry-run mode to confirm there are no pending changes. All looks good. Resolving.

@ayounsi feel free to re-open if you think there are additional modifications to do on the Netbox or automation side.