Set wgvpn keys and resolve the vpc ospf interface from its subnet
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
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/epp-validate Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful

This commit is contained in:
2026-10-17 12:51:02 +11:00
parent 27071d21ae
commit 015a516f54
5 changed files with 19 additions and 8 deletions
+12
View File
@@ -6,6 +6,7 @@ class frrouting (
String $service_name = 'frr',
Hash $daemons = {},
Hash $ospfd_interfaces = {},
Hash[Stdlib::IP::Address::V4::CIDR, Hash] $ospfd_network_interfaces = {}, # like ospfd_interfaces, keyed by a subnet the interface holds
String $ospfd_router_id = $facts['networking']['ip'],
Array[String] $ospfd_redistribute = [],
Array[String] $ospfd_networks = [],
@@ -28,6 +29,17 @@ class frrouting (
warning('frrouting: ospf_exclude_k8s_enable is true but no k8s_*_cidr provided; nothing will be filtered.')
}
$network_interfaces = $ospfd_network_interfaces.reduce({}) |$memo, $entry| {
$matched = $facts['networking']['interfaces'].filter |$name, $iface| {
$iface['bindings'] =~ Array and $iface['bindings'].any |$binding| { stdlib::ip_in_range($binding['address'], $entry[0]) }
}
if empty($matched) {
fail("frrouting: no interface holds an address in ${entry[0]}")
}
$memo + $matched.keys.reduce({}) |$acc, $name| { $acc + { $name => $entry[1] } }
}
$ospfd_interfaces_all = $ospfd_interfaces + $network_interfaces
$daemons_defaults = {
'bgpd' => false,
'ospfd' => true,
+1 -1
View File
@@ -3,7 +3,7 @@ frr defaults traditional
hostname <%= @hostname %>
no ipv6 forwarding
<% @ospfd_interfaces.each do |iface, params| -%>
<% @ospfd_interfaces_all.each do |iface, params| -%>
interface <%= iface %>
<% if params['area'] -%>
ip ospf area <%= params['area'] %>