Skip to content

Commit

Permalink
Replace deprecated IPForward with IPv{4,6}Forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
hashworks committed Jul 12, 2024
1 parent e69f10b commit 62c052a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
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
<%- end -%>

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

0 comments on commit 62c052a

Please sign in to comment.