|
16 | 16 | # @param duplicate_cn Allow multiple connections on one cn |
17 | 17 | # @param local Interface for openvpn to bind to. |
18 | 18 | # @param logfile Logfile for this openvpn server |
| 19 | +# @param manage_logfile_directory Manage the directory that the logfile is located in |
| 20 | +# @param logdirectory_user The owner user of the logfile directory |
| 21 | +# @param logdirectory_group The owner group of the logfile directory |
19 | 22 | # @param port The port the openvpn server service is running on# |
20 | 23 | # @param portshare The address and port to which non openvpn request shall be forwared, e.g. 127.0.0.1 8443 |
21 | 24 | # @param proto What IP protocol is being used. |
|
135 | 138 | Boolean $duplicate_cn = false, |
136 | 139 | String $local = $facts['ipaddress_eth0'], |
137 | 140 | Variant[Boolean, String] $logfile = false, |
| 141 | + Boolean $manage_logfile_directory = false, |
| 142 | + String[1] $logdirectory_user = 'nobody', |
| 143 | + String[1] $logdirectory_group = 'nobody', |
138 | 144 | String $port = '1194', |
139 | 145 | Optional[String] $portshare = undef, |
140 | 146 | Enum['tcp', 'tcp4', 'tcp6', 'udp', 'udp4', 'udp6'] $proto = 'tcp', |
|
241 | 247 | $lnotify = undef |
242 | 248 | } |
243 | 249 |
|
| 250 | + if $manage_logfile_directory { |
| 251 | + $logdir = dirname($logfile) |
| 252 | + file { $logdir: |
| 253 | + ensure => 'directory', |
| 254 | + owner => $logdirectory_user, |
| 255 | + group => $logdirectory_group, |
| 256 | + } |
| 257 | + } |
| 258 | + |
244 | 259 | # Selection block to enable or disable tls-server flag |
245 | 260 | # Check if we want to run as a client or not |
246 | 261 | if !$tls_client { |
|
0 commit comments