Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manifests/provider/systemd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'interface' => $interface,
'addresses' => $addresses,
'routes' => $routes,
'systemd_version' => Integer($facts['systemd_version']),
}

systemd::network { "${interface}.network":
Expand Down
3 changes: 2 additions & 1 deletion spec/fixtures/test_files/peers.network
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Name=as1234
[Network]
DHCP=no
IPv6AcceptRA=false
IPForward=yes
IPv4Forwarding=yes
IPv6Forwarding=yes

# for networkd >= 244 KeepConfiguration stops networkd from
# removing routes on this interface when restarting
Expand Down
3 changes: 2 additions & 1 deletion spec/fixtures/test_files/peers_routes.network
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Name=as1234
[Network]
DHCP=no
IPv6AcceptRA=false
IPForward=yes
IPv4Forwarding=yes
IPv6Forwarding=yes

# for networkd >= 244 KeepConfiguration stops networkd from
# removing routes on this interface when restarting
Expand Down
6 changes: 6 additions & 0 deletions templates/network.epp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Array[Hash] $addresses,
String[1] $interface,
Array[Hash[String[1], Variant[String[1], Boolean]]] $routes,
Integer $systemd_version,
| -%>
# THIS FILE IS MANAGED BY PUPPET
# based on https://dn42.dev/howto/wireguard
Expand All @@ -11,7 +12,12 @@ Name=<%= $interface %>
[Network]
DHCP=no
IPv6AcceptRA=false
<%- if $systemd_version < 256 { -%>
IPForward=yes
<%- } else { -%>
IPv4Forwarding=yes
IPv6Forwarding=yes
<%- } -%>

# for networkd >= 244 KeepConfiguration stops networkd from
# removing routes on this interface when restarting
Expand Down