diff --git a/manifests/server.pp b/manifests/server.pp index a5120df2..fe590117 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -109,6 +109,11 @@ # Multiple routes can be specified. # Default: [] # +# [*route_ipv6*] +# Array. Add IPv6 route to routing table after connection is established. +# Multiple routes can be specified. +# Default: [] +# # [*keepalive*] # String. Add keepalive directive (ping and ping-restart) to server. # Should match the form "n m". @@ -371,6 +376,7 @@ $server_bridge = '', $push = [], $route = [], + $route_ipv6 = [], $keepalive = '', $fragment = false, $ssl_key_size = 1024, diff --git a/spec/defines/openvpn_server_spec.rb b/spec/defines/openvpn_server_spec.rb index fd0b9f75..ef6c824a 100644 --- a/spec/defines/openvpn_server_spec.rb +++ b/spec/defines/openvpn_server_spec.rb @@ -127,6 +127,7 @@ 'server_ipv6' => 'fe80:1337:1337:1337::/64', 'push' => [ 'dhcp-option DNS 172.31.0.30', 'route 172.31.0.0 255.255.0.0' ], 'route' => [ '192.168.30.0 255.255.255.0', '192.168.35.0 255.255.0.0' ], + 'route_ipv6' => [ '2001:db8:1234::/64', '2001:db8:abcd::/64' ], 'keepalive' => '10 120', 'topology' => 'subnet', 'ssl_key_size' => 2048, @@ -182,6 +183,8 @@ it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^push\s+"route\s+172\.31\.0\.0\s+255\.255\.0\.0"$/) } it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^route\s+192.168.30.0\s+255.255.255.0$/) } it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^route\s+192.168.35.0\s+255.255.0.0$/) } + it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^route-ipv6\s+2001\:db8\:1234\:\:\/64$/) } + it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^route-ipv6\s+2001\:db8\:abcd\:\:\/64$/) } it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^keepalive\s+10\s+120$/) } it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^topology\s+subnet$/) } it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^management\s+1.3.3.7 1337$/) } diff --git a/templates/server.erb b/templates/server.erb index 7c411b55..a32aedb3 100644 --- a/templates/server.erb +++ b/templates/server.erb @@ -68,6 +68,9 @@ push "<%= item %>" <% @route.each do |item| -%> route <%= item %> <% end -%> +<% @route_ipv6.each do |item| -%> +route-ipv6 <%= item %> +<% end -%> <% if @sndbuf -%> sndbuf <%= @sndbuf %> <% end -%>