diff options
author | varac <varacanero@zeromail.org> | 2014-02-25 15:43:42 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2014-02-25 15:43:42 +0100 |
commit | c2539d1ea132e137d29f3183e7aac568462865b0 (patch) | |
tree | aa71997081abe88e95fd07d8e532ce8afbcf7cea /manifests | |
parent | 705fd0a13dc4d2f073819947159e28b54c286550 (diff) | |
parent | 34333c48ba5662228c37a70eb099ec9a5f96b5ac (diff) |
Merge branch 'leap_master'
Conflicts:
files/munin/dovecot
manifests/base.pp
manifests/centos.pp
manifests/debian.pp
manifests/expire.pp
manifests/init.pp
manifests/munin.pp
manifests/quota.pp
manifests/sieve.pp
manifests/sql.pp
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/base.pp | 45 | ||||
-rw-r--r-- | manifests/centos.pp | 3 | ||||
-rw-r--r-- | manifests/config/file.pp | 76 | ||||
-rw-r--r-- | manifests/debian.pp | 9 | ||||
-rw-r--r-- | manifests/deliver.pp | 4 | ||||
-rw-r--r-- | manifests/expire.pp | 59 | ||||
-rw-r--r-- | manifests/expire/mysql.pp | 20 | ||||
-rw-r--r-- | manifests/expire/sqlite.pp | 29 | ||||
-rw-r--r-- | manifests/init.pp | 15 | ||||
-rw-r--r-- | manifests/logrotate.pp | 6 | ||||
-rw-r--r-- | manifests/managesieve.pp | 10 | ||||
-rw-r--r-- | manifests/munin.pp | 9 | ||||
-rw-r--r-- | manifests/quota.pp | 1 | ||||
-rw-r--r-- | manifests/sieve.pp | 73 | ||||
-rw-r--r-- | manifests/sql.pp | 21 | ||||
-rw-r--r-- | manifests/sql/mysql.pp | 9 | ||||
-rw-r--r-- | manifests/sql/pgsql.pp | 9 | ||||
-rw-r--r-- | manifests/sql/sqlite.pp | 9 |
18 files changed, 315 insertions, 92 deletions
diff --git a/manifests/base.pp b/manifests/base.pp index 19cafbf..1cd9996 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -4,27 +4,48 @@ class dovecot::base { } file{'/etc/dovecot.conf': - source => [ "puppet:///modules/site_dovecot/config/${::fqdn}/dovecot.conf", - "puppet:///modules/site_dovecot/config/${dovecot::type}/dovecot.conf", - "puppet:///modules/site_dovecot/config/dovecot.conf", - "puppet:///modules/dovecot/config/${::operatingsystem}/dovecot.conf", - "puppet:///modules/dovecot/config/dovecot.conf" ], + source => [ "puppet:///modules/site_dovecot/config/${::fqdn}/dovecot.conf", + "puppet:///modules/site_dovecot/config/${::dovecot::type}/dovecot.conf", + 'puppet:///modules/site_dovecot/config/dovecot.conf', + "puppet:///modules/dovecot/config/${::operatingsystem}/dovecot.conf", + 'puppet:///modules/dovecot/config/dovecot.conf' ], require => Package['dovecot'], notify => Service['dovecot'], - owner => root, group => mail, mode => 0640; + owner => root, + group => mail, + mode => '0644'; } - file{'/var/log/dovecot': + file { 'dovecot_config_dir': ensure => directory, + path => '/etc/dovecot/conf.d', require => Package['dovecot'], - before => Service['dovecot'], - owner => dovecot, group => 12, mode => 0660, + owner => dovecot, + group => 0, + mode => '0755'; } - file{ [ '/var/log/dovecot/error.log', - '/var/log/dovecot/infos.log' ]: + + file { + '/var/log/dovecot': + ensure => directory, require => Package['dovecot'], before => Service['dovecot'], - owner => root, group => 12, mode => 0660; + owner => dovecot, + group => dovecot, + mode => '0750'; + + [ '/var/log/dovecot/error.log', + '/var/log/dovecot/dovecot.log' ]: + require => Package['dovecot'], + before => Service['dovecot'], + owner => root, + group => dovecot, + mode => '0660'; + } + + package { 'dovecot': + ensure => installed, + alias => 'dovecot' } include dovecot::logrotate diff --git a/manifests/centos.pp b/manifests/centos.pp index 7e7eefa..34ccdbf 100644 --- a/manifests/centos.pp +++ b/manifests/centos.pp @@ -1,6 +1,7 @@ class dovecot::centos inherits dovecot::base { + file{'/etc/sysconfig/dovecot': - source => [ "puppet:///modules/site_dovecot/sysconfig/${::fqdn}/dovecot", + source => [ "puppet:///modules/site_dovecot/sysconfig/${fqdn}/dovecot", "puppet:///modules/site_dovecot/sysconfig/${dovecot::type}/dovecot", "puppet:///modules/site_dovecot/sysconfig/dovecot", "puppet:///modules/dovecot/sysconfig/dovecot" ], diff --git a/manifests/config/file.pp b/manifests/config/file.pp new file mode 100644 index 0000000..e6e93c3 --- /dev/null +++ b/manifests/config/file.pp @@ -0,0 +1,76 @@ +define dovecot::config::file ( + $ensure = present, + $source = 'absent', + $content = 'absent', + $destination = 'absent', + $mode = 'absent', + $owner = 'absent', + $group = 'absent' +) +{ + + # the default destination is 'absent', so if the user doesn't specify a + # destination, then we use the following defaults. If different systems + # implement different locations, we can trigger here off of operatingsystem + # and change the 'dovecot_config_dir' path in base.pp to just be /etc/dovecot + $real_destination = $destination ? { + 'absent' => "/etc/dovecot/conf.d/${name}", + default => $destination + } + + $real_mode = $mode ? { + 'absent' => 0640, + default => $mode + } + + $real_owner = $owner ? { + 'absent' => root, + default => $owner + } + + $real_group = $group ? { + 'absent' => 0, + default => $group + } + + # the $name variable is set to dovecot_${name}, but the actual filename will + # be set to $name + file { "dovecot_${name}": + ensure => $ensure, + path => $real_destination, + notify => Service[dovecot], + owner => $real_owner, group => $real_group, mode => $real_mode; + } + + # the $content variable is 'absent' by default, so if the user doesn't + # specify anything for $content, then the following will be used, searching + # from the first source line until a file is found that matches. We use the + # standard search prioritizing the site_dovecot module first + case $content { + 'absent': { + $real_source = $source ? { + 'absent' => [ + "puppet:///modules/site_dovecot/config/${fqdn}/${name}", + "puppet:///modules/site_dovecot/config/${operatingsystem}/${lsbdistcodename}/${name}", + "puppet:///modules/site_dovecot/config/${operatingsystem}/${name}", + "puppet:///modules/site_dovecot/config/${name}", + "puppet:///modules/dovecot/config/${operatingsystem}/${lsbdistcodename}/${name}", + "puppet:///modules/dovecot/config/${operatingsystem}/${name}", + "puppet:///modules/dovecot/config/${name}" + ], + default => "puppet:///${source}", + } + File["dovecot_${name}"]{ + source => $real_source, + } + } + default: { + File["dovecot_${name}"]{ + content => $content, + } + } + } + File["dovecot_${name}"]{ + require => Package[dovecot], + } +} diff --git a/manifests/debian.pp b/manifests/debian.pp index dc41603..82ff579 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -1,5 +1,8 @@ class dovecot::debian inherits dovecot::base { - Package['dovecot'] { - name => 'dovecot-imapd' - } + + Package['dovecot'] { name => [ 'dovecot-common', 'dovecot-imapd', 'dovecot-pop3d' ] } + + File['/etc/dovecot.conf'] { path => '/etc/dovecot/dovecot.conf' } + } + diff --git a/manifests/deliver.pp b/manifests/deliver.pp index c501ebe..da190f1 100644 --- a/manifests/deliver.pp +++ b/manifests/deliver.pp @@ -1,6 +1,8 @@ class dovecot::deliver { + include ::dovecot - file{ [ '/var/log/dovecot/deliver.log', + + file { [ '/var/log/dovecot/deliver.log', '/var/log/dovecot/deliver-error.log' ]: require => Package['dovecot'], before => Service['dovecot'], diff --git a/manifests/expire.pp b/manifests/expire.pp index 42a170c..7eb5c6a 100644 --- a/manifests/expire.pp +++ b/manifests/expire.pp @@ -1,32 +1,58 @@ -class dovecot::expire( - $type = 'script', - $mail_location = 'absent', - $days = '14', - $directories = 'Trash\|Junk' -) { - include ::dovecot +class dovecot::expire ( $type = 'sqlite', $mail_location = '', $dirs = '', $days = '' ) { file{'/etc/cron.daily/dovecot-expire': owner => root, group => 0, mode => 0755; } - if $dovecot::expire::type == 'legacy' or $dovecot::expire::type == 'mixed' { - case $dovecot::expire::mail_location { - 'absent': { fail("Need to set \$mail_location on ${::fqdn}!") } + + if $type == 'legacy' or $type == 'mixed' { + case $mail_location { + '': { fail("Need to set \$dovecot_mail_location on $fqdn!") } + } + case $dirs { + '': { $dirs = 'Trash\|Junk' } + } + case $days { + '': { $days = '14' } } File['/etc/cron.daily/dovecot-expire']{ - content => "find ${dovecot::expire::mail_location} -regex '.*/\\.\\(${dovecot::expire::directories}\\)\\(/.*\\)?\\/\\(cur\\|new\\)/.*' -type f -ctime +${dovecot::expire::days} -delete\n" + content => "find ${mail_location} -regex '.*/\\.\\(${dirs}\\)\\(/.*\\)?\\/\\(cur\\|new\\)/.*' -type f -ctime +${days} -delete\n" } } else { + # dovecot version 1 way + if $version != 2 { + case $operatingsystem { + debian: { + augeas { "expire_cron": + context => "/files/etc/default/dovecot/rule", + changes => [ 'set /files/etc/default/dovecot/EXPIRE_CRON \'"daily"\'' ], + } + } + default: { File['/etc/cron.daily/dovecot-expire']{ content => "dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool.sh\n" } } + } + } else { + # dovecot version 2 way (no mail_location, dirs need to be space separated variables and expire script runs doveadm expunge) + # problem with this method is that it doesn't allow for different times for different mailboxes + case $dirs { + '': { $dirs = 'Trash Junk' } + } + case $days { + '': { $days = '14' } + } + File['/etc/cron.daily/dovecot-expire']{ + content => "#!/bin/sh\n\n dirs='${dirs}'\nfor mailbox in \$dirs; do doveadm expunge -A mailbox \$mailbox savedbefore ${days}d; done\n" + } + } + } - if $dovecot::expire::type != 'legacy' { + if $type != 'legacy' and $type != 'mysql' and $version != 2 { file{'/etc/dovecot-expire.conf': - source => [ "puppet:///modules/site_dovecot/expire/${::fqdn}/dovecot-expire.conf", + source => [ "puppet:///modules/site_dovecot/expire/${fqdn}/dovecot-expire.conf", "puppet:///modules/site_dovecot/expire/dovecot-expire.conf", - "puppet:///modules/dovecot/expire/${::operatingsystem}/dovecot-expire.conf", + "puppet:///modules/dovecot/expire/${operatingsystem}/dovecot-expire.conf", "puppet:///modules/dovecot/expire/dovecot-expire.conf" ], require => Package['dovecot'], notify => Service['dovecot'], @@ -39,9 +65,10 @@ class dovecot::expire( } } - case $dovecot::expire::type { - 'legacy': { info("no need to include anything for legacy type") } + case $type { + 'legacy': { info("no need to include anything for legacy mode") } 'mixed': { include ::dovecot::expire::sqlite } + 'mysql': { include ::dovecot::expire::mysql } default: { include ::dovecot::expire::sqlite } } } diff --git a/manifests/expire/mysql.pp b/manifests/expire/mysql.pp new file mode 100644 index 0000000..5256d60 --- /dev/null +++ b/manifests/expire/mysql.pp @@ -0,0 +1,20 @@ +class dovecot::expire::mysql { + + file { 'dovecot-dict-expire.conf': + source => [ "puppet:///modules/site_dovecot/expire/${fqdn}/mysql-dict-expire.conf", + "puppet:///modules/site_dovecot/expire/mysql-dict-expire.conf", + "puppet:///modules/dovecot/expire/${operatingsystem}/mysql-dict-expire.conf", + "puppet:///modules/dovecot/expire/mysql-dict-expire.conf" ], + path => $operatingsystem ? { + 'debian' => '/etc/dovecot/dovecot-dict-expire.conf', + default => '/etc/dovecot-dict-expire.conf' + }, + require => $version ? { + 2 => Package['dovecot-mysql'], + default => Package['dovecot'], + }, + notify => Service['dovecot'], + owner => root, group => 0, mode => 0600; + } + +} diff --git a/manifests/expire/sqlite.pp b/manifests/expire/sqlite.pp index a9fed4b..b1724e1 100644 --- a/manifests/expire/sqlite.pp +++ b/manifests/expire/sqlite.pp @@ -1,19 +1,22 @@ class dovecot::expire::sqlite { - include ::sqlite - file{'/var/lib/dovecot/expire.db': - ensure => file, - replace => false, - require => Package['sqlite'], - owner => root, group => 0, mode => 0600; - } - file{'/var/lib/dovecot/expire.sql': - source => "puppet:///modules/dovecot/expire/expire.sqlite.sql", - require => File['/var/lib/dovecot/expire.db'], - notify => Exec['create_expire_db'], - owner => root, group => 0, mode => 0600; + + include dovecot::sql::sqlite + + file { + '/var/lib/dovecot/expire.db': + ensure => file, + replace => false, + require => Package['sqlite'], + owner => root, group => 0, mode => 0600; + + '/var/lib/dovecot/expire.sql': + source => "puppet:///modules/dovecot/expire/expire.sqlite.sql", + require => File['/var/lib/dovecot/expire.db'], + notify => Exec['create_expire_db'], + owner => root, group => 0, mode => 0600; } - exec{'create_expire_db': + exec { 'create_expire_db': command => 'cat /var/lib/dovecot/expire.sql | sqlite3 /var/lib/dovecot/expire.db', refreshonly => true, } diff --git a/manifests/init.pp b/manifests/init.pp index a3b34ad..29d6da7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -5,16 +5,17 @@ class dovecot( $pgsql = false, $mysql = false, $nagios_checks = { - 'imap-hostname' => $::fqdn, - 'pop3-hostname' => $::fqdn, + 'imap-hostname' => $fqdn, + 'pop3-hostname' => $fqdn, }, $munin_checks = true, - $manage_shorewall = true + $manage_shorewall = true, + $version = 2 ){ - case $::operatingsystem { - centos: { include dovecot::centos } - 'Debian','Ubuntu': { include dovecot::debian } - default: { include dovecot::base } + case $operatingsystem { + centos: { include dovecot::centos } + debian: { include dovecot::debian } + default: { include dovecot::base } } if $dovecot::sqlite or $dovecot::pgsql or $dovecot::mysql { diff --git a/manifests/logrotate.pp b/manifests/logrotate.pp index a26e1c2..c86f0f0 100644 --- a/manifests/logrotate.pp +++ b/manifests/logrotate.pp @@ -1,11 +1,13 @@ class dovecot::logrotate { + include logrotate + augeas { "logrotate_dovecot": context => "/files/etc/logrotate.d/dovecot/rule", - changes => [ 'set file /var/log/dovecot/*.log', 'set rotate 3', 'set schedule weekly', + changes => [ 'set file /var/log/dovecot/*.log', 'set rotate 3', 'set schedule daily', 'set compress compress', 'set sharedscripts sharedscripts', - 'set create/mode 0660', 'set create/owner root', 'set create/group mail', + 'set create/mode 0660', 'set create/owner dovecot', 'set create/group dovecot', 'set postrotate "/bin/kill -USR1 `cat /var/run/dovecot/master.pid 2>/dev/null` 2> /dev/null || true"' ], } } diff --git a/manifests/managesieve.pp b/manifests/managesieve.pp index efe4435..625de4a 100644 --- a/manifests/managesieve.pp +++ b/manifests/managesieve.pp @@ -5,7 +5,13 @@ class dovecot::managesieve( 'sieve-hostname' => $::fqdn, } ) { - package{'dovecot-managesieve': + + $managesieve_package = $operatingsystem ? { + debian => managesieved, + default => managesieve + } + + package { $managesieve_package: ensure => installed, before => Service['dovecot'], } @@ -18,7 +24,7 @@ class dovecot::managesieve( } if $dovecot::managesieve::nagios_checks { - nagios::service{"managesieve": + nagios::service { "managesieve": check_command => "check_managesieve!${dovecot::managesieve::nagios_checks['sieve-hostname']}"; } } diff --git a/manifests/munin.pp b/manifests/munin.pp index 56b6945..5996604 100644 --- a/manifests/munin.pp +++ b/manifests/munin.pp @@ -1,12 +1,7 @@ class dovecot::munin { + munin::plugin::deploy{'dovecot': source => "dovecot/munin/dovecot", - config => "env.logfile /var/log/dovecot/infos.log -group mail" - } -> file{'/var/lib/munin/plugin-state/plugin-dovecot.state': - ensure => file, - owner => munin, - group => mail, - mode => 0660; + config => "env.logfile /var/log/dovecot/dovecot.log\ngroup dovecot" } } diff --git a/manifests/quota.pp b/manifests/quota.pp index a4a3255..c44e0c1 100644 --- a/manifests/quota.pp +++ b/manifests/quota.pp @@ -1,4 +1,5 @@ class dovecot::quota { + file{'/usr/libexec/dovecot/quota-warning.sh': source => [ "puppet:///modules/site_dovecot/quota/quota-warning.sh", "puppet:///modules/dovecot/quota/quota-warning.sh" ], diff --git a/manifests/sieve.pp b/manifests/sieve.pp index c0aa54c..5666420 100644 --- a/manifests/sieve.pp +++ b/manifests/sieve.pp @@ -1,38 +1,77 @@ class dovecot::sieve { + include ::dovecot + package{'dovecot-sieve': ensure => installed, before => Service['dovecot'], } - file{'/var/lib/dovecot-sieve': - ensure => directory, - owner => root, group => 0, mode => 0644; + $sieve_location = $operatingsystem ? { + debian => '/var/lib/dovecot/sieve', + default => '/var/lib/dovecot-sieve' } - file{'/var/lib/dovecot-sieve/global': + + file { + $sieve_location: + ensure => directory, + owner => root, group => mail, mode => 0775; + + "${sieve_location}/global": ensure => directory, recurse => true, purge => true, force => true, notify => Exec['compile_global_sieve'], owner => root, group => root, mode => 0644; - } - file{'/var/lib/dovecot-sieve/default.sieve': - source => [ "puppet:///modules/site_dovecot/sieve/${::fqdn}/default.sieve", - "puppet:///modules/site_dovecot/sieve/default.sieve", - "puppet:///modules/dovecot/sieve/${::operatingsystem}/default.sieve", + + "${sieve_location}/default.sieve": + source => [ "puppet:///modules/site_dovecot/sieve/${fqdn}/default.sieve", + "puppet:///modules/site_dovecot/sieve/default.sieve", + "puppet:///modules/dovecot/sieve/${operatingsystem}/default.sieve", "puppet:///modules/dovecot/sieve/default.sieve" ], notify => Exec['compile_default_sieve'], + owner => root, group => root, mode => 0644; + + # this is for sequential sieve scripts, configured in 90-sieve.conf as: + # sieve_before = /var/lib/dovecot/sieve/default.sieve + "${sieve_location}/before.sieve": + source => [ "puppet:///modules/site_dovecot/sieve/${fqdn}/before.sieve", + "puppet:///modules/site_dovecot/sieve/before.sieve", + "puppet:///modules/dovecot/sieve/${operatingsystem}/before.sieve", + "puppet:///modules/dovecot/sieve/before.sieve" ], + notify => Exec['compile_before_sieve'], + owner => root, group => root, mode => 0644; + + # this is for sequential sieve scripts, configured in 90-sieve.conf as: + # sieve_after = /var/lib/dovecot/sieve/after.sieve + "${sieve_location}/after.sieve": + source => [ "puppet:///modules/site_dovecot/sieve/${fqdn}/after.sieve", + "puppet:///modules/site_dovecot/sieve/after.sieve", + "puppet:///modules/dovecot/sieve/${operatingsystem}/after.sieve", + "puppet:///modules/dovecot/sieve/after.sieve" ], + notify => Exec['compile_after_sieve'], owner => root, group => root, mode => 0644; } - exec{'compile_default_sieve': - command => 'sievec /var/lib/dovecot-sieve/default.sieve', - creates => '/var/lib/dovecot-sieve/default.svbin', - require => File['/var/lib/dovecot-sieve/default.sieve'], - } - exec{'compile_global_sieve': - command => 'sievec /var/lib/dovecot-sieve/global/', - refreshonly => true, + exec { + 'compile_default_sieve': + command => "sievec ${sieve_location}/default.sieve", + creates => "${sieve_location}/default.svbin", + require => File["${sieve_location}/default.sieve"]; + + 'compile_before_sieve': + command => "sievec ${sieve_location}/before.sieve", + creates => "${sieve_location}/before.svbin", + require => File["${sieve_location}/before.sieve"]; + + 'compile_after_sieve': + command => "sievec ${sieve_location}/after.sieve", + creates => "${sieve_location}/after.svbin", + require => File["${sieve_location}/after.sieve"]; + + 'compile_global_sieve': + command => "sievec ${sieve_location}/global/", + refreshonly => true; } } diff --git a/manifests/sql.pp b/manifests/sql.pp index 0db154b..b35ebdc 100644 --- a/manifests/sql.pp +++ b/manifests/sql.pp @@ -1,15 +1,27 @@ class dovecot::sql { + file{'/etc/dovecot-sql.conf': - source => [ "puppet:///modules/site_dovecot/sql/${::fqdn}/dovecot-sql.conf", + source => [ "puppet:///modules/site_dovecot/sql/${fqdn}/dovecot-sql.conf", "puppet:///modules/site_dovecot/sql/${dovecot::type}/dovecot-sql.conf", "puppet:///modules/site_dovecot/sql/dovecot-sql.conf", - "puppet:///modules/site/sql/${::operatingsystem}/dovecot-sql.conf", + "puppet:///modules/site/sql/${operatingsystem}/dovecot-sql.conf", "puppet:///modules/site/sql/dovecot-sql.conf" ], require => Package['dovecot'], notify => Service['dovecot'], owner => root, group => 0, mode => 0600; } + file { '/etc/dovecot-dict-sql.conf': + source => [ "puppet:///modules/site_dovecot/sql/${fqdn}/dovecot-dict-sql.conf", + "puppet:///modules/site_dovecot/sql/${dovecot::type}/dovecot-dict-sql.conf", + "puppet:///modules/site_dovecot/sql/dovecot-dict-sql.conf", + "puppet:///modules/site/sql/${operatingsystem}/dovecot-dict-sql.conf", + "puppet:///modules/site/sql/dovecot-dict-sql.conf" ], + require => Package['dovecot'], + notify => Service['dovecot'], + owner => root, group => 0, mode => 0600; + } + if $dovecot::mysql { include ::dovecot::sql::mysql } @@ -19,4 +31,9 @@ class dovecot::sql { if $dovecot::sqlite { include ::dovecot::sql::sqlite } + + if $operatingsystem == 'Debian' { + File['/etc/dovecot-sql.conf'] { path => '/etc/dovecot/dovecot-sql.conf' } + File['/etc/dovecot-dict-sql.conf'] { path => '/etc/dovecot/dovecot-dict-sql.conf' } + } } diff --git a/manifests/sql/mysql.pp b/manifests/sql/mysql.pp index 378ed41..56cbb13 100644 --- a/manifests/sql/mysql.pp +++ b/manifests/sql/mysql.pp @@ -1,6 +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'], File['/etc/dovecot-dict-sql.conf'] ]; + } } } diff --git a/manifests/sql/pgsql.pp b/manifests/sql/pgsql.pp index 530e878..39f1b64 100644 --- a/manifests/sql/pgsql.pp +++ b/manifests/sql/pgsql.pp @@ -1,6 +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 bc07fb7..c2a848e 100644 --- a/manifests/sql/sqlite.pp +++ b/manifests/sql/sqlite.pp @@ -1,6 +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'], + } } } |