summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-02-24 20:16:43 +0100
committermh <mh@immerda.ch>2010-02-24 20:18:56 +0100
commit0b488591cadc239ecd1e6beebbc76da63baece2c (patch)
treec8efbe51bc0ed9352755cfec20a65a3e2ce21aa8 /manifests/init.pp
parenta7659da65aeaad7d0c4aaf89e6150b8ed260f751 (diff)
refactoring - no behavior change
- everything goes into its own file -> autolookup - order the params of the define nicer -> debugging! - move nagios stuff to the init class -> configure module at the very first point - move variable version enforcing to init class -> configure module at the very first point
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp90
1 files changed, 4 insertions, 86 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index f3fa0d2..3c3cbe4 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -19,63 +19,15 @@
class stunnel {
+ case $stunnel_ensure_version {
+ '': { $stunnel_ensure_version = "present" }
+ }
+
case $operatingsystem {
debian: { include stunnel::debian }
default: { include stunnel::default }
}
- define service ( $ensure = present, $accept = false, $capath = false,
- $cafile = false, $cert = false, $chroot = false,
- $ciphers = false, $client = false, $compress =
- false, $connect = false, $crlpath = false, $crlfile
- = false, $debuglevel = false, $delay = false, $egd =
- false, $engine = false, $engineCtrl = false,
- $enginenum = false, $exec = false, $execargs =
- false, $failover = false, $ident = false, $key =
- false, $local = false, $oscp = false, $ocspflag =
- false, $options = false, $output = false, $pid =
- false, $protocol = false, $protocolauthentication =
- false, $protocolhost = false, $protocolpassword =
- false, $protocolusername = false, $pty = false,
- $retry = false, $rndbytes = false, $rndfile = false,
- $rndoverwrite = false, $service = false, $session =
- false, $setuid = "stunnel4", $setgid = "stunnel4",
- $socket = [ "l:TCP_NODELAY=1", "r:TCP_NODELAY=1"],
- $sslversion = "SSLv3", $stack = false, $syslog =
- false, $timeoutbusy = false, $timeoutclose = false,
- $timeoutconnect = false, $timeoutidle = false,
- $transparent = false, $verify = false ) {
-
- $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'),
- owner => root, group => 0, mode => 0600,
- require => File["/etc/stunnel"],
- notify => Service[stunnel];
- }
- }
-}
-
-class stunnel::base {
-
- case $stunnel_ensure_version {
- '': { $stunnel_ensure_version = "present" }
- }
-
- file { "/etc/stunnel":
- ensure => directory;
- }
-
- service { 'stunnel':
- name => 'stunnel',
- enable => true,
- ensure => running,
- hasstatus => false;
- }
-
if $use_nagios {
case $nagios_stunnel_procs {
'false': { info("We aren't doing nagios checks for stunnel on ${fqdn}" ) }
@@ -83,37 +35,3 @@ class stunnel::base {
}
}
}
-
-class stunnel::linux inherits stunnel::base {
-
- if $stunnel_ensure_version == '' { $stunnel_ensure_version = 'installed' }
- package { 'stunnel':
- ensure => $stunnel_ensure_version
- }
-}
-
-
-class stunnel::debian inherits stunnel::linux {
-
- Package[stunnel] {
- name => 'stunnel4',
- }
-
- Service[stunnel] {
- name => 'stunnel4',
- pattern => '/usr/bin/stunnel4',
- }
-
- # make the /etc/default/stunnel configurable with a variable
- case $stunnel_startboot {
- '': { $stunnel_startboot = '1' }
- }
-
- file { '/etc/default/stunnel4':
- content => template("stunnel/Debian/default"),
- require => Package['stunnel4'],
- notify => Service['stunnel4'],
- owner => root, group => 0, mode => 0644;
- }
-}
-