diff --git a/manifests/install.pp b/manifests/install.pp index f5aa7bdb..0451663d 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -39,8 +39,9 @@ } - file { [ '/etc/openvpn', '/etc/openvpn/keys' ]: - ensure => directory, - require => Package['openvpn'], + file { + [ '/etc/openvpn', '/etc/openvpn/keys', $::openvpn::params::status_log_dir, ]: + ensure => directory, + require => Package['openvpn']; } } diff --git a/manifests/params.pp b/manifests/params.pp index 0c0f7ba1..91218522 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -92,5 +92,5 @@ /(Debian|RedHat)/ => true, default => false } - + $status_log_dir = '/var/log/openvpn' } diff --git a/manifests/server.pp b/manifests/server.pp index 03201092..bf874f83 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -348,8 +348,8 @@ $logfile = false, $port = '1194', $proto = 'tcp', - $status_log = "${name}/openvpn-status.log", $status_version = '', + $status_log = "${name}-status.log", $server = '', $server_ipv6 = '', $server_bridge = '', diff --git a/templates/server.erb b/templates/server.erb index 94118a68..b324586b 100644 --- a/templates/server.erb +++ b/templates/server.erb @@ -37,7 +37,7 @@ user <%= @user %> <% if @logfile -%> log-append <%= @logfile %> <% end -%> -status <%= @status_log %> +status <%= scope.lookupvar('openvpn::params::status_log_dir') %>/<%= scope.lookupvar('status_log') %> <% if @status_version != '' -%> status-version <%= @status_version %> <% end -%>