summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-04-03 13:18:26 -0400
committerMicah Anderson <micah@riseup.net>2013-04-03 13:18:26 -0400
commit0bec75e40e5aa4458c960242298ab455fcffc88e (patch)
tree9535121f3fe347cda1c03fc57f4e00907201a73e
parent6c27f8faf0caef51af5958ad8aa01b3aef4ea2ed (diff)
switch to parameterized classes, changing the variable names as appropriate to remove the redundant stunnel_ prefix
-rw-r--r--manifests/debian.pp12
-rw-r--r--manifests/init.pp15
-rw-r--r--manifests/linux.pp4
-rw-r--r--templates/Debian/default4
4 files changed, 15 insertions, 20 deletions
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
}
}
diff --git a/templates/Debian/default b/templates/Debian/default
index 85c4754..ccfefa5 100644
--- a/templates/Debian/default
+++ b/templates/Debian/default
@@ -3,11 +3,11 @@
# September 2003
# Change to one to enable stunnel automatic startup
-ENABLED=<%= stunnel_startboot %>
+ENABLED=<%= startboot %>
FILES="/etc/stunnel/*.conf"
OPTIONS=""
# Change to one to enable ppp restart scripts
PPP_RESTART=0
-<%= stunnel_default_extra %>
+<%= default_extra %>