diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/base.pp | 8 | ||||
-rw-r--r-- | manifests/centos.pp | 35 | ||||
-rw-r--r-- | manifests/debian.pp | 18 | ||||
-rw-r--r-- | manifests/init.pp | 13 | ||||
-rw-r--r-- | manifests/linux.pp | 6 | ||||
-rw-r--r-- | manifests/service.pp | 25 |
6 files changed, 60 insertions, 45 deletions
diff --git a/manifests/base.pp b/manifests/base.pp index 3061902..9fed2de 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -1,13 +1,13 @@ class stunnel::base { - file { "/etc/stunnel": + file { '/etc/stunnel': ensure => directory; } service { 'stunnel': - name => 'stunnel', - enable => true, - ensure => running, + ensure => running, + name => 'stunnel', + enable => true, hasstatus => false; } } diff --git a/manifests/centos.pp b/manifests/centos.pp index 1b971a3..39f18c7 100644 --- a/manifests/centos.pp +++ b/manifests/centos.pp @@ -1,16 +1,19 @@ class stunnel::centos inherits stunnel::linux { - file{'/etc/init.d/stunnel': - source => "puppet:///modules/stunnel/${operatingsystem}/stunnel.init", + file { '/etc/init.d/stunnel': + source => "puppet:///modules/stunnel/${::operatingsystem}/stunnel.init", require => Package['stunnel'], - before => Service['stunnel'], - owner => root, group => 0, mode => 0755; + before => Service['stunnel'], + owner => root, + group => 0, + mode => '0755'; } - user::managed{ "stunnel": - homedir => "/var/run/stunnel", - shell => "/sbin/nologin", - uid => 105, gid => 105; + user::managed { 'stunnel': + homedir => '/var/run/stunnel', + shell => '/sbin/nologin', + uid => 105, + gid => 105; } Service['stunnel']{ @@ -18,13 +21,15 @@ class stunnel::centos inherits stunnel::linux { require => [ User['stunnel'], File['/etc/init.d/stunnel'] ] } - file{'/etc/stunnel/stunnel.conf': - source => [ "puppet:///modules/site-stunnel/${fqdn}/stunnel.conf", - "puppet:///modules/site-stunnel/${stunnel_cluster}/stunnel.conf", - "puppet:///modules/site-stunnel/stunnel.conf", - "puppet:///modules/stunnel/${operatingsystem}/stunnel.conf" ], + file { '/etc/stunnel/stunnel.conf': + source => [ "puppet:///modules/site-stunnel/${::fqdn}/stunnel.conf", + "puppet:///modules/site-stunnel/${stunnel_cluster}/stunnel.conf", + 'puppet:///modules/site-stunnel/stunnel.conf', + 'puppet:///modules/stunnel/${::operatingsystem}/stunnel.conf' ], require => Package['stunnel'], - notify => Service['stunnel'], - owner => root, group => 0, mode => 0600; + notify => Service['stunnel'], + owner => root, + group => 0, + mode => '0600'; } } diff --git a/manifests/debian.pp b/manifests/debian.pp index 83f9981..a480a2c 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -1,31 +1,35 @@ class stunnel::debian inherits stunnel::linux { - + Package[stunnel] { name => 'stunnel4', } - + Service[stunnel] { name => 'stunnel4', pattern => '/usr/bin/stunnel4', } - + # make the /etc/default/stunnel ENABLED configurable with a variable # and default to on case $stunnel_startboot { '': { $stunnel_startboot = '1' } + default: { $stunnel_startboot = '1' } } # make the /etc/default/stunnel extra configurable with a variable # and default to adding nothing to the default file case $stunnel_default_extra { '': { $stunnel_default_extra = '' } + default: { $stunnel_default_extra = '' } } - + file { '/etc/default/stunnel4': - content => template("stunnel/Debian/default"), + content => template('stunnel/Debian/default'), require => Package['stunnel4'], - notify => Service['stunnel4'], - owner => root, group => 0, mode => 0644; + notify => Service['stunnel4'], + owner => root, + group => 0, + mode => '0644'; } } diff --git a/manifests/init.pp b/manifests/init.pp index b08058e..58902ee 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,10 +20,11 @@ class stunnel { case $stunnel_ensure_version { - '': { $stunnel_ensure_version = "present" } + '': { $stunnel_ensure_version = 'present' } + default: { $stunnel_ensure_version = 'present' } } - case $operatingsystem { + case $::operatingsystem { debian: { include stunnel::debian } centos: { include stunnel::centos } default: { include stunnel::default } @@ -31,8 +32,12 @@ class stunnel { if $use_nagios { case $nagios_stunnel_procs { - 'false': { info("We aren't doing nagios checks for stunnel on ${fqdn}" ) } - default: { nagios::service { "stunnel": check_command => "nagios-stat-proc!/usr/bin/stunnel4!6!5!proc"; } } + false: { info("We aren't doing nagios checks for stunnel on ${::fqdn}" ) } + default: { nagios::service + { 'stunnel': + check_command => 'nagios-stat-proc!/usr/bin/stunnel4!6!5!proc'; + } + } } } } diff --git a/manifests/linux.pp b/manifests/linux.pp index 800df37..b4b99c6 100644 --- a/manifests/linux.pp +++ b/manifests/linux.pp @@ -1,7 +1,7 @@ class stunnel::linux inherits stunnel::base { - - if $stunnel_ensure_version == '' { $stunnel_ensure_version = 'installed' } + + if $stunnel_ensure_version == '' { $stunnel_ensure_version = 'installed' } package { 'stunnel': ensure => $stunnel_ensure_version } -} +} diff --git a/manifests/service.pp b/manifests/service.pp index fb24168..b925d00 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, @@ -54,15 +54,16 @@ define stunnel::service ( $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'; } } - |