Skip to content

Commit

Permalink
Don't use a special parameter, just set it as default, fixes #139
Browse files Browse the repository at this point in the history
  • Loading branch information
luxflux committed Mar 5, 2015
1 parent 4b96f65 commit 13ad3c6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


file {
[ '/etc/openvpn', '/etc/openvpn/keys', $::openvpn::params::status_log_dir, ]:
[ '/etc/openvpn', '/etc/openvpn/keys', '/var/log/openvpn', ]:
ensure => directory,
require => Package['openvpn'];
}
Expand Down
2 changes: 0 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# limitations under the License.
#
class openvpn::params {
$status_log_dir = '/var/log/openvpn'

case $::osfamily {
'RedHat': {
$group = 'nobody'
Expand Down
4 changes: 2 additions & 2 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
#
# [*status_log*]
# String. Logfile for periodic dumps of the vpn service status
# Default: "${name}/openvpn-status.log"
# Default: "/var/log/openvpn/${name}-status.log"
#
# [*status_version*]
# Integer. Choose the status file format version number. Can be 1, 2 or 3 and defaults to 1
Expand Down Expand Up @@ -349,7 +349,7 @@
$port = '1194',
$proto = 'tcp',
$status_version = '',
$status_log = "${name}-status.log",
$status_log = "/var/log/openvpn/${name}-status.log",
$server = '',
$server_ipv6 = '',
$server_bridge = '',
Expand Down
1 change: 1 addition & 0 deletions spec/classes/openvpn_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

it { should contain_file('/etc/openvpn').with('ensure' => 'directory') }
it { should contain_file('/etc/openvpn/keys').with('ensure' => 'directory') }
it { should contain_file('/var/log/openvpn').with('ensure' => 'directory') }

describe 'installed packages' do
context 'debian' do
Expand Down
6 changes: 3 additions & 3 deletions spec/defines/openvpn_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^group\s+nogroup$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^user\s+nobody$/) }
it { should_not contain_file('/etc/openvpn/test_server.conf').with_content(/^log\-append\s+test_server\/openvpn\.log$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^status\s+test_server\/openvpn\-status\.log$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(%r{^status\s+/var/log/openvpn/test_server-status\.log$}) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^dev\s+tun0$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^local\s+1\.2\.3\.4$/) }
it { should_not contain_file('/etc/openvpn/test_server.conf').with_content(/^ifconfig-pool-persist/) }
Expand Down Expand Up @@ -118,7 +118,7 @@
'group' => 'someone',
'user' => 'someone',
'logfile' => '/var/log/openvpn/test_server.log',
'status_log' => '/var/log/openvpn/test_server_status.log',
'status_log' => '/tmp/test_server_status.log',
'dev' => 'tun1',
'up' => '/tmp/up',
'down' => '/tmp/down',
Expand Down Expand Up @@ -172,7 +172,7 @@
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^group\s+someone$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^user\s+someone$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(%r{^log\-append\s+/var/log/openvpn/test_server\.log$}) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(%r{^status\s+/var/log/openvpn/test_server_status\.log$}) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(%r{^status\s+/tmp/test_server_status\.log$}) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^dev\s+tun1$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^local\s+2\.3\.4\.5$/) }
it { should contain_file('/etc/openvpn/test_server.conf').with_content(/^server\s+2\.3\.4\.0\s+255\.255\.0\.0$/) }
Expand Down
2 changes: 1 addition & 1 deletion templates/server.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ user <%= @user %>
<% if @logfile -%>
log-append <%= @logfile %>
<% end -%>
status <%= scope.lookupvar('openvpn::params::status_log_dir') %>/<%= scope.lookupvar('status_log') %>
status <%= @status_log %>
<% if @status_version != '' -%>
status-version <%= @status_version %>
<% end -%>
Expand Down

0 comments on commit 13ad3c6

Please sign in to comment.