Skip to content

Commit

Permalink
Merge pull request #154 from andrekeller/feature_iroute-ipv6
Browse files Browse the repository at this point in the history
feature (client-specific-config): add iroute-ipv6 parameter support.
  • Loading branch information
luxflux committed May 2, 2015
2 parents ef31bc6 + e66bdf2 commit 4e2d9e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions manifests/client_specific_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
# Array. Array of iroute combinations.
# Default: []
#
# [*iroute_ipv6*]
# Array. Array of IPv6 iroute combinations.
# Default: []
#
# [*route*]
# Array. Array of route combinations pushed to client.
# Default: []
Expand Down Expand Up @@ -76,6 +80,7 @@
$server,
$ensure = present,
$iroute = [],
$iroute_ipv6 = [],
$route = [],
$ifconfig = false,
$dhcp_options = [],
Expand Down
4 changes: 3 additions & 1 deletion spec/defines/openvpn_client_specific_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@
let(:params) do
{:server => 'test_server',
:iroute => ['10.0.1.0 255.255.255.0'],
:iroute_ipv6 => ['2001:db8:1234::/64'],
:ifconfig => '10.10.10.2 255.255.255.0',
:route => ['10.200.100.0 255.255.255.0 10.10.10.1'],
:route => ['10.200.100.0 255.255.255.0 10.10.10.1'],
:dhcp_options => ['DNS 8.8.8.8'],
:redirect_gateway => true}
end

it { should contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(/^iroute 10.0.1.0 255.255.255.0$/) }
it { should contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(/^iroute-ipv6 2001\:db8\:1234\:\:\/64$/) }
it { should contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(/^ifconfig-push 10.10.10.2 255.255.255.0$/) }
it { should contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(/^push dhcp-option DNS 8.8.8.8$/) }
it { should contain_file('/etc/openvpn/test_server/client-configs/test_client').with_content(/^push redirect-gateway def1$/) }
Expand Down
3 changes: 3 additions & 0 deletions templates/client_specific_config.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<% @iroute.each do |iroute| -%>
iroute <%= iroute %>
<% end -%>
<% @iroute_ipv6.each do |iroute_ipv6| -%>
iroute-ipv6 <%= iroute_ipv6 %>
<% end -%>
<% if ifconfig = @ifconfig -%>
ifconfig-push <%= ifconfig %>
<% end -%>
Expand Down

0 comments on commit 4e2d9e1

Please sign in to comment.