From 1726fa37027571e88a8c8ed7758e2f7e8ca12070 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 11 May 2025 16:13:10 +1000 Subject: [PATCH] feat: exclude anycast0 addresses - exclude managing anycast interfaces on per-node basis - update all hosts with anycast loopback0 to anycast0 --- hieradata/nodes/ausyd1nxvm2005.main.unkin.net.yaml | 4 ++-- hieradata/nodes/ausyd1nxvm2006.main.unkin.net.yaml | 4 ++-- hieradata/nodes/ausyd1nxvm2007.main.unkin.net.yaml | 4 ++-- hieradata/nodes/ausyd1nxvm2008.main.unkin.net.yaml | 4 ++-- hieradata/nodes/ausyd1nxvm2009.main.unkin.net.yaml | 4 ++-- hieradata/nodes/ausyd1nxvm2029.main.unkin.net.yaml | 4 ++-- hieradata/nodes/ausyd1nxvm2030.main.unkin.net.yaml | 4 ++-- hieradata/nodes/ausyd1nxvm2031.main.unkin.net.yaml | 4 ++-- hieradata/nodes/ausyd1nxvm2032.main.unkin.net.yaml | 4 ++-- hieradata/nodes/ausyd1nxvm2033.main.unkin.net.yaml | 4 ++-- hieradata/nodes/ausyd1nxvm2034.main.unkin.net.yaml | 4 ++-- site/profiles/manifests/dns/base.pp | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/hieradata/nodes/ausyd1nxvm2005.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2005.main.unkin.net.yaml index fbb4494..f873956 100644 --- a/hieradata/nodes/ausyd1nxvm2005.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2005.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('profiles::consul::server::anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/hieradata/nodes/ausyd1nxvm2006.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2006.main.unkin.net.yaml index fbb4494..f873956 100644 --- a/hieradata/nodes/ausyd1nxvm2006.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2006.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('profiles::consul::server::anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/hieradata/nodes/ausyd1nxvm2007.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2007.main.unkin.net.yaml index fbb4494..f873956 100644 --- a/hieradata/nodes/ausyd1nxvm2007.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2007.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('profiles::consul::server::anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/hieradata/nodes/ausyd1nxvm2008.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2008.main.unkin.net.yaml index fbb4494..f873956 100644 --- a/hieradata/nodes/ausyd1nxvm2008.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2008.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('profiles::consul::server::anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/hieradata/nodes/ausyd1nxvm2009.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2009.main.unkin.net.yaml index fbb4494..f873956 100644 --- a/hieradata/nodes/ausyd1nxvm2009.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2009.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('profiles::consul::server::anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/hieradata/nodes/ausyd1nxvm2029.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2029.main.unkin.net.yaml index 00d319e..ad02274 100644 --- a/hieradata/nodes/ausyd1nxvm2029.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2029.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('dns_master_anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/hieradata/nodes/ausyd1nxvm2030.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2030.main.unkin.net.yaml index 00d319e..ad02274 100644 --- a/hieradata/nodes/ausyd1nxvm2030.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2030.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('dns_master_anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/hieradata/nodes/ausyd1nxvm2031.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2031.main.unkin.net.yaml index 00d319e..ad02274 100644 --- a/hieradata/nodes/ausyd1nxvm2031.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2031.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('dns_master_anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/hieradata/nodes/ausyd1nxvm2032.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2032.main.unkin.net.yaml index 92f6c57..69fc05d 100644 --- a/hieradata/nodes/ausyd1nxvm2032.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2032.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('dns_resolver_anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/hieradata/nodes/ausyd1nxvm2033.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2033.main.unkin.net.yaml index 92f6c57..69fc05d 100644 --- a/hieradata/nodes/ausyd1nxvm2033.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2033.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('dns_resolver_anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/hieradata/nodes/ausyd1nxvm2034.main.unkin.net.yaml b/hieradata/nodes/ausyd1nxvm2034.main.unkin.net.yaml index 92f6c57..69fc05d 100644 --- a/hieradata/nodes/ausyd1nxvm2034.main.unkin.net.yaml +++ b/hieradata/nodes/ausyd1nxvm2034.main.unkin.net.yaml @@ -11,7 +11,7 @@ networking::interfaces: type: physical forwarding: true dhcp: true - loopback0: + anycast0: type: dummy ipaddress: "%{hiera('dns_resolver_anycast_ip')}" netmask: 255.255.255.255 @@ -24,7 +24,7 @@ frrouting::ospfd_redistribute: frrouting::ospfd_interfaces: eth0: area: 0.0.0.0 - loopback0: + anycast0: area: 0.0.0.0 frrouting::daemons: ospfd: true diff --git a/site/profiles/manifests/dns/base.pp b/site/profiles/manifests/dns/base.pp index 903229e..8d10a85 100644 --- a/site/profiles/manifests/dns/base.pp +++ b/site/profiles/manifests/dns/base.pp @@ -46,8 +46,8 @@ class profiles::dns::base ( # export dns records for client $facts['networking']['interfaces'].each | $interface, $data | { - # exclude those without ipv4 address, and lo - if $data['ip'] and $interface != 'lo' { + # exclude those without ipv4 address, lo and anycast addresses + if $data['ip'] and $interface != 'lo' and $interface !~ /^anycast[0-9]$/ { # use defaults for the primary_interface if $interface == $primary_interface {