diff options
author | Micah Anderson <micah@riseup.net> | 2013-06-11 14:00:27 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2013-06-12 20:22:24 -0400 |
commit | a336f39c441b7b3706278332cc63782d2de0e299 (patch) | |
tree | 619e2a2e4aa0c117978a08485acda3becf01c2aa /manifests/service.pp | |
parent | 75d387fc8aff12232fdeae2efbbfccdd91f94656 (diff) |
Previous to this commit, when a stunnel::service definition was removed, the
/etc/stunnel/${name}.conf was left, and the stunnel remained running. Also, if
you changed a parameter in a stunnel::service definition, the .conf file was
changed, but the service restart may not happen properly.
This commit adds functionality to properly clean up running stunnels that are no
longer managed, and restart managed ones whose parameters have changed
Diffstat (limited to 'manifests/service.pp')
-rw-r--r-- | manifests/service.pp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/manifests/service.pp b/manifests/service.pp index fd64f9b..666826d 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -58,14 +58,17 @@ define stunnel::service ( $real_client = $client ? { default => 'yes' } $real_pid = $pid ? { false => "/${name}.pid", default => $pid } - file { "/etc/stunnel/${name}.conf": - ensure => $ensure, - content => template('stunnel/service.conf.erb'), - require => File['/etc/stunnel'], - notify => Service[stunnel], - owner => root, - group => 0, - mode => '0600'; + $stunnel_compdir = "${::puppet_vardir}/stunnel4/configs" + + file { + "${stunnel_compdir}/${name}.conf": + ensure => $ensure, + content => template('stunnel/service.conf.erb'), + require => Package['stunnel'], + notify => Exec['refresh_stunnel'], + owner => root, + group => 0, + mode => '0600'; } if $use_nagios { |