summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2011-09-02 16:31:32 -0400
committerMicah Anderson <micah@riseup.net>2011-09-02 16:31:32 -0400
commitefd742c81f629d653b9d9a29a400f37d0a44dee9 (patch)
treecee307ffd7d294a20ca00870c8806bfe1c7403b6
parent4ddd09c2a38bd6f491f6e3a10035bf2f514ab76b (diff)
the new version of dovecot (version 2) has a number of differences from version 1, so I added a $version class parameter (defaulting to 2) so we can have different configurations for the different versions.
for version 2, debian does have different sql packages, so we test the above variable before attempting to install the packages, rather than test for the $operatingsystem in sql.pp
-rw-r--r--manifests/init.pp1
-rw-r--r--manifests/sql.pp28
-rw-r--r--manifests/sql/mysql.pp8
-rw-r--r--manifests/sql/pgsql.pp8
-rw-r--r--manifests/sql/sqlite.pp8
5 files changed, 28 insertions, 25 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 09af028..de8259c 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -9,6 +9,7 @@ class dovecot(
},
$munin_checks = true,
$manage_shorewall = true
+ $version = 2
){
case $operatingsystem {
centos: { include dovecot::centos }
diff --git a/manifests/sql.pp b/manifests/sql.pp
index fc9a864..528fd94 100644
--- a/manifests/sql.pp
+++ b/manifests/sql.pp
@@ -11,21 +11,17 @@ class dovecot::sql {
owner => root, group => 0, mode => 0600;
}
- case $operatingsystem {
- centos: {
- if $dovecot::mysql {
- include ::dovecot::sql::mysql
- }
- if $dovecot::pgsql {
- include ::dovecot::sql::pgsql
- }
- if $dovecot::sqlite {
- include ::dovecot::sql::sqlite
- }
- }
- debian: {
- File['/etc/dovecot-sql.conf'] { path => '/etc/dovecot/dovecot-sql.conf' }
- }
- default: {}
+ if $dovecot::mysql {
+ include ::dovecot::sql::mysql
+ }
+ if $dovecot::pgsql {
+ include ::dovecot::sql::pgsql
+ }
+ if $dovecot::sqlite {
+ include ::dovecot::sql::sqlite
+ }
+
+ if $operatingsystem == 'Debian' {
+ File['/etc/dovecot-sql.conf'] { path => '/etc/dovecot/dovecot-sql.conf' }
}
}
diff --git a/manifests/sql/mysql.pp b/manifests/sql/mysql.pp
index 95149d7..f4c1a4a 100644
--- a/manifests/sql/mysql.pp
+++ b/manifests/sql/mysql.pp
@@ -1,7 +1,9 @@
class dovecot::sql::mysql {
- package { 'dovecot-mysql':
- ensure => installed,
- before => File['/etc/dovecot-sql.conf'],
+ if $version == 2 {
+ package { 'dovecot-mysql':
+ ensure => installed,
+ before => File['/etc/dovecot-sql.conf'],
+ }
}
}
diff --git a/manifests/sql/pgsql.pp b/manifests/sql/pgsql.pp
index 8fa2ae1..39f1b64 100644
--- a/manifests/sql/pgsql.pp
+++ b/manifests/sql/pgsql.pp
@@ -1,7 +1,9 @@
class dovecot::sql::pgsql {
- package { 'dovecot-pgsql':
- ensure => installed,
- before => File['/etc/dovecot-sql.conf'],
+ if $version == 2 {
+ package { 'dovecot-pgsql':
+ ensure => installed,
+ before => File['/etc/dovecot-sql.conf'],
+ }
}
}
diff --git a/manifests/sql/sqlite.pp b/manifests/sql/sqlite.pp
index 5a2bb06..c2a848e 100644
--- a/manifests/sql/sqlite.pp
+++ b/manifests/sql/sqlite.pp
@@ -1,7 +1,9 @@
class dovecot::sql::sqlite {
- package { 'dovecot-sqlite':
- ensure => installed,
- before => File['/etc/dovecot-sql.conf'],
+ if $version == 2 {
+ package { 'dovecot-sqlite':
+ ensure => installed,
+ before => File['/etc/dovecot-sql.conf'],
+ }
}
}