From ea88b2d0597527467a0013de3c1c173d5e4d136f Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 14 Dec 2009 22:35:38 +0100 Subject: add sqlite support, refactor how sql is done, add readme --- README | 14 ++++++++++++++ manifests/init.pp | 4 ++++ manifests/sql.pp | 9 ++++++--- manifests/sql/sqlite.pp | 6 ++++++ 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 README create mode 100644 manifests/sql/sqlite.pp diff --git a/README b/README new file mode 100644 index 0000000..a5b068f --- /dev/null +++ b/README @@ -0,0 +1,14 @@ +dovecot +------- + +Variables: +---------- + +$dovecot_sql_sqlite: + - Whether sqlite support should be included + +$dovecot_sql_mysql: + - Whether Mysql support should be included + +$dovecot_sql_pgsql: + - Whether PostgreSQL support should be included diff --git a/manifests/init.pp b/manifests/init.pp index 3739c07..f0f4b29 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -6,6 +6,10 @@ class dovecot { include dovecot::base + if $dovecot_sql_sqlite or $dovecot_sql_pgsql or $dovecot_sql_mysql { + include dovecot::sql + } + if $use_shorewall { include shorewall::rules::pop3 include shorewall::rules::imap diff --git a/manifests/sql.pp b/manifests/sql.pp index 779bd3a..4969d88 100644 --- a/manifests/sql.pp +++ b/manifests/sql.pp @@ -1,5 +1,4 @@ class dovecot::sql { - include ::dovecot file{'/etc/dovecot-sql.conf': source => [ "puppet://$server/modules/site-dovecot/sql/${fqdn}/dovecot-sql.conf", "puppet://$server/modules/site-dovecot/sql/${dovecot_type}/dovecot-sql.conf", @@ -11,9 +10,13 @@ class dovecot::sql { owner => root, group => 0, mode => 0600; } - if ($dovecot_sql_type=='mysql'){ + if $dovecot_sql_mysql{ include ::dovecot::sql::mysql - } else { + } + if $dovecot_sql_pqsql{ include ::dovecot::sql::pgsql } + if $dovecot_sql_sqlite{ + include ::dovecot::sql::sqlite + } } diff --git a/manifests/sql/sqlite.pp b/manifests/sql/sqlite.pp new file mode 100644 index 0000000..bc07fb7 --- /dev/null +++ b/manifests/sql/sqlite.pp @@ -0,0 +1,6 @@ +class dovecot::sql::sqlite { + package{'dovecot-sqlite': + ensure => installed, + before => File['/etc/dovecot-sql.conf'], + } +} -- cgit v1.2.3