Skip to content

Commit

Permalink
Merge pull request #156 from andrekeller/feature-server-nobind
Browse files Browse the repository at this point in the history
feature (server): add nobind parameter support.
  • Loading branch information
luxflux committed May 12, 2015
2 parents 6ae2350 + 50ee23c commit baffc40
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@
# with client configuration
# Default: true
#
# [*nobind*]
# Boolean. Whether or not to bind to a specific port number.
# Default: false
#
# [*custom_options*]
# Hash of additional options that you want to append to the configuration file.
#
Expand Down Expand Up @@ -426,6 +430,7 @@
$shared_ca = undef,
$autostart = undef,
$ns_cert_type = true,
$nobind = false,
$custom_options = {},
) {

Expand Down
3 changes: 3 additions & 0 deletions spec/defines/openvpn_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
'ping_timer_rem' => true,
'tls_auth' => true,
'tls_client' => true,
'nobind' => true,
} }

let(:facts) { {
Expand Down Expand Up @@ -267,6 +268,8 @@
it { should_not contain_file('/etc/openvpn/test_client.conf').with_content(/^dh/) }
it { should contain_file('/etc/openvpn/test_client.conf').with_content(%r{^tls-client$}) }
it { should contain_file('/etc/openvpn/test_client.conf').with_content(%r{^key-direction 1$}) }
it { should contain_file('/etc/openvpn/test_client.conf').with_content(%r{^nobind$}) }
it { should_not contain_file('/etc/openvpn/test_client.conf').with_content(%r{^port\s+\d+$}) }

it { should_not contain_openvpn__ca('test_client') }
end
Expand Down
4 changes: 4 additions & 0 deletions templates/server.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ proto <%= @proto %>-server
<% else -%>
proto <%= @proto %>
<% end -%>
<% if @nobind -%>
nobind
<% else -%>
port <%= @port %>
<% end -%>
<% if @real_tls_server -%>
tls-server
<% end -%>
Expand Down

0 comments on commit baffc40

Please sign in to comment.