neoloc/mpls_ldp_frr (#255)

Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/255
This commit was merged in pull request #255.
This commit is contained in:
2025-04-24 16:51:31 +10:00
parent c24babe309
commit 2321186ad5
7 changed files with 121 additions and 4 deletions
+25 -1
View File
@@ -10,12 +10,17 @@ class frrouting (
Array[String] $ospfd_redistribute = [],
Array[String] $ospfd_networks = [],
Boolean $ospfd_default_originate_always = false,
Boolean $mpls_te_enabled = false,
Optional[String] $mpls_ldp_router_id = undef,
Optional[String] $mpls_ldp_transport_addr = undef,
Array[String] $mpls_ldp_interfaces = [],
) {
$daemons_defaults = {
'bgpd' => false,
'ospfd' => true,
'ospf6d' => false,
'ldpd' => false,
'ripd' => false,
'ripngd' => false,
'isisd' => false,
@@ -32,7 +37,7 @@ class frrouting (
'staticd' => false,
}
$daemons_merged = merge($daemons, $daemons_defaults)
$daemons_merged = merge($daemons_defaults, $daemons)
if $manage_package {
package { $package_name:
@@ -62,4 +67,23 @@ class frrouting (
hasrestart => true,
}
}
if $mpls_ldp_router_id and $mpls_ldp_transport_addr and !empty($mpls_ldp_interfaces) {
file { '/etc/modules-load.d/mpls_ldp_modules.conf':
ensure => file,
content => @(EOT/L),
# Load MPLS Kernel Modules
mpls_router
mpls_iptunnel
| EOT
}
['mpls_router', 'mpls_iptunnel'].each |$mod| {
exec { "load_${mod}":
command => "/sbin/modprobe ${mod}",
unless => "/sbin/lsmod | /bin/grep -q ^${mod}",
path => ['/sbin', '/bin', '/usr/sbin', '/usr/bin'],
}
}
}
}
+1
View File
@@ -12,6 +12,7 @@ zebra_options=" -A 127.0.0.1 -s 90000000"
bgpd_options=" -A 127.0.0.1"
ospfd_options=" -A 127.0.0.1"
ospf6d_options=" -A ::1"
ldpd_options=" -A 127.0.0.1"
ripd_options=" -A 127.0.0.1"
ripngd_options=" -A ::1"
isisd_options=" -A 127.0.0.1"
+18
View File
@@ -24,4 +24,22 @@ router ospf
<% if @ospfd_default_originate_always -%>
default-information originate always
<% end -%>
<% if @mpls_te_enabled -%>
capability opaque
mpls-te on
mpls-te router-address <%= @ospfd_router_id %>
mpls-te inter-as area 0.0.0.0
<% end -%>
exit
<% if @mpls_ldp_router_id and @mpls_ldp_transport_addr and @mpls_ldp_interfaces.any? -%>
mpls ldp
router-id <%= @mpls_ldp_router_id %>
address-family ipv4
discovery transport-address <%= @mpls_ldp_transport_addr %>
<% @mpls_ldp_interfaces.each do |iface| -%>
interface <%= iface %>
exit
<% end -%>
exit-address-family
exit
<% end -%>