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

Commit

Permalink
Merge pull request #70 from cirrax/fix_tls_auth_generation_dependency
Browse files Browse the repository at this point in the history
use tags to notify service, new dependency for tls_auth generation
  • Loading branch information
zachfi authored Feb 7, 2021
2 parents 920ea8d + 75bc781 commit f36a3de
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 f36a3de

Please sign in to comment.