Skip to content

Commit 63fc931

Browse files
authored
Merge pull request #235 from invidian/add-openvpn-ifconfig-ipv6-support
client_specific_config: add support for ifconfig-ipv6-push
2 parents f70882a + ae8e6c6 commit 63fc931

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

manifests/client_specific_config.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# @param iroute_ipv6 Array of IPv6 iroute combinations.
99
# @param route Array of route combinations pushed to client.
1010
# @param ifconfig IP configuration to push to the client.
11+
# @param ifconfig_ipv6 IPv6 configuration to push to the client.
1112
# @param dhcp_options DHCP options to push to the client.
1213
# @param redirect_gateway Redirect all traffic to gateway
1314
# @param ensure Sets the client specific configuration file status (present or absent)
@@ -27,6 +28,7 @@
2728
Array[String] $iroute_ipv6 = [],
2829
Array[String] $route = [],
2930
Variant[Boolean, String] $ifconfig = false,
31+
Optional[String[1]] $ifconfig_ipv6 = undef,
3032
Array[String] $dhcp_options = [],
3133
Boolean $redirect_gateway = false,
3234
) {

spec/defines/openvpn_client_specific_config_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
iroute: ['10.0.1.0 255.255.255.0'],
4343
iroute_ipv6: ['2001:db8:1234::/64'],
4444
ifconfig: '10.10.10.2 255.255.255.0',
45+
ifconfig_ipv6: '2001:db8:0:123::2/64 2001:db8:0:123::1',
4546
route: ['10.200.100.0 255.255.255.0 10.10.10.1'],
4647
dhcp_options: ['DNS 8.8.8.8'],
4748
redirect_gateway: true
@@ -51,6 +52,7 @@
5152
it { is_expected.to contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(%r{^iroute 10.0.1.0 255.255.255.0$}) }
5253
it { is_expected.to contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(%r{^iroute-ipv6 2001:db8:1234::/64$}) }
5354
it { is_expected.to contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(%r{^ifconfig-push 10.10.10.2 255.255.255.0$}) }
55+
it { is_expected.to contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(%r{^ifconfig-ipv6-push 2001:db8:0:123::2/64 2001:db8:0:123::1$}) }
5456
it { is_expected.to contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(%r{^push "dhcp-option DNS 8.8.8.8"$}) }
5557
it { is_expected.to contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(%r{^push "redirect-gateway def1"$}) }
5658
it { is_expected.to contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(%r{^push "route 10.200.100.0 255.255.255.0 10.10.10.1"$}) }

templates/client_specific_config.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ iroute-ipv6 <%= iroute_ipv6 %>
77
<% if ifconfig = @ifconfig -%>
88
ifconfig-push <%= ifconfig %>
99
<% end -%>
10+
<% if @ifconfig_ipv6 -%>
11+
ifconfig-ipv6-push <%= @ifconfig_ipv6 %>
12+
<% end -%>
1013
<% @dhcp_options.each do |option| -%>
1114
push "dhcp-option <%= option %>"
1215
<% end -%>

0 commit comments

Comments
 (0)