Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Commit

Permalink
use tags to notify service, new dependency for tls_auth generation
Browse files Browse the repository at this point in the history
service should start after tls_auth certificate is generated.
  • Loading branch information
trefzer committed Jan 4, 2021
1 parent 4e3e32a commit 75bc781
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
}

if $manage_service {
Exec <| tag == 'openvpn' |> ~> Service['openvpn']
File <| tag == 'openvpn' |> ~> Service['openvpn']

service { 'openvpn':
ensure => running,
enable => true,
Expand Down
9 changes: 3 additions & 6 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
group => 0,
mode => '0600',
content => template('openvpn/server.conf.erb'),
tag => 'openvpn',
}

$fq_dh = $dh ? {
Expand All @@ -91,19 +92,15 @@
cwd => $openvpn_dir,
command => "${openssl} dhparam -out ${fq_dh} ${dh_size}",
creates => $fq_dh,
tag => 'openvpn',
}

if $tls_auth {
exec { 'create tls_auth key':
cwd => $openvpn_dir,
command => "${openvpn_path} --genkey --secret ta.key",
creates => "${openvpn_dir}/ta.key",
tag => 'openvpn',
}
}

if $openvpn::manage_service {
Exec["create ${dh}"] ~> Service['openvpn']

File["${openvpn_dir}/openvpn.conf"] ~> Service['openvpn']
}
}

0 comments on commit 75bc781

Please sign in to comment.