summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-12-12 17:17:03 +0100
committermh <mh@immerda.ch>2010-12-12 17:17:03 +0100
commit9a3b45399e4c02c92a3006d7a42063d44a16da76 (patch)
treed2e718eaf43d7bdaf2a284c302304cce2ed6d4c9
parent93351a1ea80f144563830910e4689cc4121fe804 (diff)
refactor classes to use parametrized classes
-rw-r--r--manifests/init.pp18
-rw-r--r--manifests/sql.pp6
2 files changed, 13 insertions, 11 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 6c9093d..542aa58 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,24 +1,26 @@
-# modules/skeleton/manifests/init.pp - manage dovecot stuff
-# Copyright (C) 2009 admin@immerda.ch
-#
-
# we take rpms from fedora
-class dovecot {
+class dovecot(
+ $sqlite = false,
+ $pgsql = false,
+ $mysql = false,
+ $munin_checks = true,
+ $manage_shorewall = true
+){
case $operatingsystem {
centos: { include dovecot::centos }
default: { include dovecot::base }
}
- if $dovecot_sql_sqlite or $dovecot_sql_pgsql or $dovecot_sql_mysql {
+ if $dovecot::sqlite or $dovecot::pgsql or $dovecot::mysql {
include dovecot::sql
}
- if $use_shorewall {
+ if $dovecot::manage_shorewall {
include shorewall::rules::pop3
include shorewall::rules::imap
}
- if $use_munin {
+ if $dovecot::munin_checks {
include dovecot::munin
}
}
diff --git a/manifests/sql.pp b/manifests/sql.pp
index c4ddc04..538f5d7 100644
--- a/manifests/sql.pp
+++ b/manifests/sql.pp
@@ -10,13 +10,13 @@ class dovecot::sql {
owner => root, group => 0, mode => 0600;
}
- if $dovecot_sql_mysql{
+ if $dovecot::mysql {
include ::dovecot::sql::mysql
}
- if $dovecot_sql_pgsql{
+ if $dovecot::pgsql {
include ::dovecot::sql::pgsql
}
- if $dovecot_sql_sqlite{
+ if $dovecot::sqlite {
include ::dovecot::sql::sqlite
}
}