diff options
Diffstat (limited to 'manifests/service.pp')
-rw-r--r-- | manifests/service.pp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/manifests/service.pp b/manifests/service.pp index fb24168..fd64f9b 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -40,10 +40,10 @@ define stunnel::service ( $rndoverwrite = false, $service = false, $session = false, - $setuid = "stunnel4", - $setgid = "stunnel4", - $socket = [ "l:TCP_NODELAY=1", "r:TCP_NODELAY=1"], - $sslversion = "SSLv3", + $setuid = 'stunnel4', + $setgid = 'stunnel4', + $socket = [ 'l:TCP_NODELAY=1', 'r:TCP_NODELAY=1'], + $sslversion = 'SSLv3', $stack = false, $syslog = false, $timeoutbusy = false, @@ -51,18 +51,26 @@ define stunnel::service ( $timeoutconnect = false, $timeoutidle = false, $transparent = false, + $use_nagios = false, $verify = false ) { - $real_client = $client ? { default => "yes" } + $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; + ensure => $ensure, + content => template('stunnel/service.conf.erb'), + require => File['/etc/stunnel'], + notify => Service[stunnel], + owner => root, + group => 0, + mode => '0600'; } -} + if $use_nagios { + nagios::service { "stunnel_${name}": + check_command => "nagios-stat-proc!/usr/bin/stunnel4 /etc/stunnel/${name}.conf!6!5!proc"; + } + } +} |