From 0bec75e40e5aa4458c960242298ab455fcffc88e Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 3 Apr 2013 13:18:26 -0400 Subject: switch to parameterized classes, changing the variable names as appropriate to remove the redundant stunnel_ prefix --- manifests/debian.pp | 12 ++++++------ manifests/init.pp | 15 +++++---------- manifests/linux.pp | 4 ++-- 3 files changed, 13 insertions(+), 18 deletions(-) (limited to 'manifests') diff --git a/manifests/debian.pp b/manifests/debian.pp index a480a2c..156ef75 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -11,16 +11,16 @@ class stunnel::debian inherits stunnel::linux { # make the /etc/default/stunnel ENABLED configurable with a variable # and default to on - case $stunnel_startboot { - '': { $stunnel_startboot = '1' } - default: { $stunnel_startboot = '1' } + case $startboot { + '': { $startboot = '1' } + default: { $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 = '' } + case $default_extra { + '': { $default_extra = '' } + default: { $default_extra = '' } } file { '/etc/default/stunnel4': diff --git a/manifests/init.pp b/manifests/init.pp index b1437d2..270540d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -17,17 +17,12 @@ # TODO: warn on cert/key issues, fail on false accept? -class stunnel { - - case $stunnel_ensure_version { - '': { $stunnel_ensure_version = 'present' } - default: { $stunnel_ensure_version = 'present' } - } - +class stunnel ( $ensure_version = 'present', $startboot = '1', $default_extra ) +{ case $::operatingsystem { - debian: { include stunnel::debian } - centos: { include stunnel::centos } - default: { include stunnel::default } + debian: { class { 'stunnel::debian': } } + centos: { class { 'stunnel::centos': } } + default: { class { 'stunnel::default': } } } if $use_nagios { diff --git a/manifests/linux.pp b/manifests/linux.pp index b4b99c6..eb1b10a 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 $ensure_version == '' { $ensure_version = 'installed' } package { 'stunnel': - ensure => $stunnel_ensure_version + ensure => $ensure_version } } -- cgit v1.2.3