summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/dovecot.pp5
-rw-r--r--manifests/firma.pp6
-rw-r--r--manifests/firma/packages.pp5
-rw-r--r--manifests/init.pp16
-rw-r--r--manifests/mlmmj.pp28
-rw-r--r--manifests/mlmmj/list.pp19
-rw-r--r--manifests/mlmmj/packages.pp5
-rw-r--r--manifests/mlmmj/web.pp33
-rw-r--r--manifests/mlmmj/web/disabled.pp18
-rw-r--r--manifests/packages.pp54
-rw-r--r--manifests/schleuder/packages.pp5
-rw-r--r--manifests/sympa.pp65
-rw-r--r--manifests/sympa/disabled.pp56
-rw-r--r--manifests/sympa/packages.pp5
-rw-r--r--manifests/sympa/web.pp32
-rw-r--r--manifests/sympa/web/disabled.pp9
-rw-r--r--manifests/virtual.pp8
-rw-r--r--manifests/virtual/database.pp (renamed from manifests/postfixadmin.pp)42
-rw-r--r--manifests/virtual/packages.pp29
-rw-r--r--manifests/virtual/params.pp5
-rw-r--r--manifests/virtual/web.pp73
-rw-r--r--manifests/web.pp169
22 files changed, 327 insertions, 360 deletions
diff --git a/manifests/dovecot.pp b/manifests/dovecot.pp
index 8619bcd..ac22bfb 100644
--- a/manifests/dovecot.pp
+++ b/manifests/dovecot.pp
@@ -1,10 +1,5 @@
class mail::dovecot {
- $database_user = hiera('postfixadmin_database_user', 'postfix')
- $database_host = hiera('postfixadmin_database_host', 'localhost')
- $database_name = hiera('postfixadmin_database_name', 'postfix')
- $database_password = hiera('postfixadmin_database_password', '')
-
# Dovecot
service { "dovecot":
ensure => running,
diff --git a/manifests/firma.pp b/manifests/firma.pp
index ec59879..a832878 100644
--- a/manifests/firma.pp
+++ b/manifests/firma.pp
@@ -3,16 +3,16 @@ class mail::firma(
) {
# Firma subsystems
- include mail::packages::firma
+ include mail::firma::packages
postfix::config { "firma_destination_recipient_limit": value => '1', nonstandard => true }
postfix::transport_regexp_snippet { 'firma_transport_regexp':
- content => template('mail/postfix/firma/transport_regexp.erb'),
+ content => template('mail/firma/transport_regexp.erb'),
}
postfix::virtual_regexp_snippet { 'firma_virtual_regexp':
- content => template('mail/postfix/firma/virtual_regexp.erb'),
+ content => template('mail/firma/virtual_regexp.erb'),
}
postfix::transport { "${subdomain}.$domain":
diff --git a/manifests/firma/packages.pp b/manifests/firma/packages.pp
new file mode 100644
index 0000000..31b538e
--- /dev/null
+++ b/manifests/firma/packages.pp
@@ -0,0 +1,5 @@
+class mail::firma::packages {
+ package { 'expect':
+ ensure => installed,
+ }
+}
diff --git a/manifests/init.pp b/manifests/init.pp
index 02a681b..a75022d 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -2,19 +2,3 @@
# Mail module
#
-import "dovecot.pp"
-import "header_checks.pp"
-import "system.pp"
-import "packages.pp"
-import "postfixadmin"
-import "sasl.pp"
-import "tls.pp"
-import "amavisd.pp"
-import "web.pp"
-import "sympa.pp"
-import "base.pp"
-import "spamassassin.pp"
-import "firma.pp"
-import "mlmmj.pp"
-import "hidden.pp"
-import "virtual.pp"
diff --git a/manifests/mlmmj.pp b/manifests/mlmmj.pp
index 91a1fc0..93de661 100644
--- a/manifests/mlmmj.pp
+++ b/manifests/mlmmj.pp
@@ -2,8 +2,8 @@ class mail::mlmmj(
$subdomain = hiera('mlmmj_subdomain', 'mlmmj')
) {
- include mail::packages::mlmmj
- include mail::web::mlmmj::disabled
+ include mail::mlmmj::packages
+ include mail::mlmmj::web::disabled
group { 'mlmmj':
ensure => present,
@@ -33,30 +33,10 @@ class mail::mlmmj(
#}
#postfix::transport_regexp_snippet { 'mlmmj_transport_regexp':
- # content => template('mail/postfix/mlmmj/transport_regexp.erb'),
+ # content => template('mail/mlmmj/transport_regexp.erb'),
#}
postfix::virtual_regexp_snippet { 'mlmmj_virtual_regexp':
- content => template('mail/postfix/mlmmj/virtual_regexp.erb'),
- }
-
- # From transport(5):
- #
- # The trivial-rewrite(8) server disallows regular expression
- # substitution of $1 etc. in regular expression lookup
- # tables, because that could open a security hole (Postfix
- # version 2.3 and later).
- #
- # That's why we need one definition per mailing list.
- define list($ensure = 'present') {
- postfix::transport_regexp_snippet { "mlmmj_transport_regexp-${name}":
- content => "/^(${name})\\@.*$/ mlmmj:${name}\n",
- ensure => $ensure,
- }
-
- postfix::transport_regexp_snippet { "mlmmj_transport_regexp-${name}-request":
- content => "/^(${name})\\+.*\\@.*$/ mlmmj:${name}\n",
- ensure => $ensure,
- }
+ content => template('mail/mlmmj/virtual_regexp.erb'),
}
}
diff --git a/manifests/mlmmj/list.pp b/manifests/mlmmj/list.pp
new file mode 100644
index 0000000..13f30a9
--- /dev/null
+++ b/manifests/mlmmj/list.pp
@@ -0,0 +1,19 @@
+# From transport(5):
+#
+# The trivial-rewrite(8) server disallows regular expression
+# substitution of $1 etc. in regular expression lookup
+# tables, because that could open a security hole (Postfix
+# version 2.3 and later).
+#
+# That's why we need one definition per mailing list.
+define mail::mlmmj::list($ensure = 'present') {
+ postfix::transport_regexp_snippet { "mlmmj_transport_regexp-${name}":
+ content => "/^(${name})\\@.*$/ mlmmj:${name}\n",
+ ensure => $ensure,
+ }
+
+ postfix::transport_regexp_snippet { "mlmmj_transport_regexp-${name}-request":
+ content => "/^(${name})\\+.*\\@.*$/ mlmmj:${name}\n",
+ ensure => $ensure,
+ }
+}
diff --git a/manifests/mlmmj/packages.pp b/manifests/mlmmj/packages.pp
new file mode 100644
index 0000000..34c133d
--- /dev/null
+++ b/manifests/mlmmj/packages.pp
@@ -0,0 +1,5 @@
+class mail::mlmmj::packages {
+ package { 'mlmmj':
+ ensure => installed,
+ }
+}
diff --git a/manifests/mlmmj/web.pp b/manifests/mlmmj/web.pp
new file mode 100644
index 0000000..b0a79d4
--- /dev/null
+++ b/manifests/mlmmj/web.pp
@@ -0,0 +1,33 @@
+class mail::mlmmj::web inherits websites::setup {
+ $mlmmj_subdomain = hiera('mlmmj_subdomain')
+
+ apache::site { "${mail::mlmmj::subdomain}":
+ docroot => "/usr/share/mlmmj-php-web-admin",
+ owner => 'mlmmj',
+ group => 'mlmmj',
+ mpm_user => 'mlmmj',
+ mpm_group => 'mlmmj',
+ manage_user => false,
+ require => Package['mlmmj-php-web-admin'],
+ }
+
+ package { [ 'mlmmj-php-web', 'mlmmj-php-web-admin' ]:
+ ensure => present,
+ }
+
+ file { '/etc/mlmmj-php-web-admin':
+ ensure => directory,
+ owner => mlmmj,
+ group => mlmmj,
+ mode => 0640,
+ }
+
+ file { '/etc/mlmmj-php-web-admin/htpasswd':
+ ensure => present,
+ owner => mlmmj,
+ group => mlmmj,
+ mode => 0640,
+ source => [ "puppet:///modules/site_mail/mlmmj/htpasswd",
+ "puppet:///modules/mail/mlmmj/htpasswd" ],
+ }
+}
diff --git a/manifests/mlmmj/web/disabled.pp b/manifests/mlmmj/web/disabled.pp
new file mode 100644
index 0000000..bf29d7b
--- /dev/null
+++ b/manifests/mlmmj/web/disabled.pp
@@ -0,0 +1,18 @@
+class mail::mlmmj::web::disabled inherits mail::web::mlmmj {
+ Apache::Site["$mlmmj_subdomain"] {
+ ensure => absent,
+ }
+
+ Package[ 'mlmmj-php-web', 'mlmmj-php-web-admin' ] {
+ ensure => absent,
+ }
+
+ File['/etc/mlmmj-php-web-admin'] {
+ ensure => absent,
+ force => true,
+ }
+
+ File['/etc/mlmmj-php-web-admin/htpasswd'] {
+ ensure => absent,
+ }
+}
diff --git a/manifests/packages.pp b/manifests/packages.pp
index 2e3649d..45c1063 100644
--- a/manifests/packages.pp
+++ b/manifests/packages.pp
@@ -8,57 +8,3 @@ class mail::packages {
ensure => installed,
}
}
-
-class mail::packages::virtual {
- package { [ 'libpam-mysql', 'libgsasl7' ]:
- ensure => installed,
- }
-
- package { [ 'postfix-mysql', 'dovecot-imapd', 'maildrop' ]:
- ensure => installed,
- }
-
- package { [ 'squirrelmail', 'squirrelmail-locales', 'imp4' ]:
- ensure => installed,
- }
-
- package { 'php-crypt-gpg':
- ensure => installed,
- }
-
- # Squeeze (or newer) packages
- if $::lsbdistcodename != 'lenny' {
- package { [ 'roundcube', 'roundcube-sqlite', 'roundcube-plugins', 'roundcube-plugins-extra' ]:
- ensure => latest,
- }
- }
-
- # We'll force SSL through the proxy
- package { 'squirrelmail-secure-login':
- ensure => absent,
- }
-}
-
-class mail::packages::sympa {
- package { 'sympa':
- ensure => installed,
- }
-}
-
-class mail::packages::schleuder {
- package { 'schleuder':
- ensure => installed,
- }
-}
-
-class mail::packages::mlmmj {
- package { 'mlmmj':
- ensure => installed,
- }
-}
-
-class mail::packages::firma {
- package { 'expect':
- ensure => installed,
- }
-}
diff --git a/manifests/schleuder/packages.pp b/manifests/schleuder/packages.pp
new file mode 100644
index 0000000..66e824a
--- /dev/null
+++ b/manifests/schleuder/packages.pp
@@ -0,0 +1,5 @@
+class mail::schleuder::packages {
+ package { 'schleuder':
+ ensure => installed,
+ }
+}
diff --git a/manifests/sympa.pp b/manifests/sympa.pp
index 34ea084..2984469 100644
--- a/manifests/sympa.pp
+++ b/manifests/sympa.pp
@@ -14,8 +14,8 @@ class mail::sympa(
}
# Sympa subsystems
- include mail::web::sympa
- include mail::packages::sympa
+ include mail::sympa::web
+ include mail::sympa::packages
#
# Database configuration
@@ -103,11 +103,11 @@ class mail::sympa(
}
postfix::transport_regexp_snippet { 'sympa_transport_regexp':
- content => template('mail/postfix/sympa/transport_regexp.erb'),
+ content => template('mail/sympa/transport_regexp.erb'),
}
postfix::virtual_regexp_snippet { 'sympa_virtual_regexp':
- content => template('mail/postfix/sympa/virtual_regexp.erb'),
+ content => template('mail/sympa/virtual_regexp.erb'),
}
postfix::config {
@@ -173,60 +173,3 @@ class mail::sympa(
notify => Exec["newaliases"],
}
}
-
-class mail::sympa::disabled inherits mail::sympa {
- include mail::web::sympa::disabled
-
- Service["sympa"] {
- ensure => stopped,
- enable => false,
- }
-
- Cron["sympa-restart"] {
- ensure => absent,
- }
-
- Postfix::Transport_regexp_snippet['sympa_transport_regexp'] {
- content => undef,
- }
-
- Postfix::Virtual_regexp_snippet['sympa_virtual_regexp'] {
- content => undef,
- }
-
- Mailalias["sympa"] {
- ensure => absent,
- }
-
- Mailalias["sympa-request"] {
- ensure => absent,
- }
-
- Mailalias["sympa-owner"] {
- ensure => absent,
- }
-
- Mailalias["abuse-feedback-report"] {
- ensure => absent,
- }
-
- Mailalias["bounce+*"] {
- ensure => absent,
- }
-
- Mailalias["listserv"] {
- ensure => absent,
- }
-
- Mailalias["listserv-request"] {
- ensure => absent,
- }
-
- Mailalias["listserv-owner"] {
- ensure => absent,
- }
-
- Mailalias["majordomo"] {
- ensure => absent,
- }
-}
diff --git a/manifests/sympa/disabled.pp b/manifests/sympa/disabled.pp
new file mode 100644
index 0000000..b81ce98
--- /dev/null
+++ b/manifests/sympa/disabled.pp
@@ -0,0 +1,56 @@
+class mail::sympa::disabled inherits mail::sympa {
+ include mail::web::sympa::disabled
+
+ Service["sympa"] {
+ ensure => stopped,
+ enable => false,
+ }
+
+ Cron["sympa-restart"] {
+ ensure => absent,
+ }
+
+ Postfix::Transport_regexp_snippet['sympa_transport_regexp'] {
+ content => undef,
+ }
+
+ Postfix::Virtual_regexp_snippet['sympa_virtual_regexp'] {
+ content => undef,
+ }
+
+ Mailalias["sympa"] {
+ ensure => absent,
+ }
+
+ Mailalias["sympa-request"] {
+ ensure => absent,
+ }
+
+ Mailalias["sympa-owner"] {
+ ensure => absent,
+ }
+
+ Mailalias["abuse-feedback-report"] {
+ ensure => absent,
+ }
+
+ Mailalias["bounce+*"] {
+ ensure => absent,
+ }
+
+ Mailalias["listserv"] {
+ ensure => absent,
+ }
+
+ Mailalias["listserv-request"] {
+ ensure => absent,
+ }
+
+ Mailalias["listserv-owner"] {
+ ensure => absent,
+ }
+
+ Mailalias["majordomo"] {
+ ensure => absent,
+ }
+}
diff --git a/manifests/sympa/packages.pp b/manifests/sympa/packages.pp
new file mode 100644
index 0000000..4a90727
--- /dev/null
+++ b/manifests/sympa/packages.pp
@@ -0,0 +1,5 @@
+class mail::sympa::packages {
+ package { 'sympa':
+ ensure => installed,
+ }
+}
diff --git a/manifests/sympa/web.pp b/manifests/sympa/web.pp
new file mode 100644
index 0000000..a174e62
--- /dev/null
+++ b/manifests/sympa/web.pp
@@ -0,0 +1,32 @@
+class mail::sympa::web inherits websites::setup {
+ apache::site { "${sympa::subdomain}":
+ docroot => "${apache::www_folder}/${sympa::subdomain}",
+ source => true,
+ owner => sympa,
+ group => sympa,
+ mpm => false,
+ }
+
+ package { [ 'apache2-suexec', 'libapache2-mod-fcgid' ]:
+ ensure => present,
+ }
+
+ apache::module { "fcgid":
+ ensure => present,
+ require => Package["libapache2-mod-fcgid"],
+ }
+
+ apache::module { "suexec":
+ ensure => present,
+ require => Package["apache2-suexec"],
+ }
+
+ file { "${apache::www_folder}/${sympa::subdomain}/wwsympa.fcgi":
+ ensure => present,
+ owner => sympa,
+ group => sympa,
+ mode => 0550,
+ content => "#!/bin/sh\n/usr/lib/cgi-bin/sympa/wwsympa.fcgi\n",
+ require => File["${apache::www_folder}/${sympa::subdomain}"],
+ }
+}
diff --git a/manifests/sympa/web/disabled.pp b/manifests/sympa/web/disabled.pp
new file mode 100644
index 0000000..1d34641
--- /dev/null
+++ b/manifests/sympa/web/disabled.pp
@@ -0,0 +1,9 @@
+class mail::sympa::web::disabled inherits mail::web::sympa {
+ Apache::Site["$sympa_subdomain"] {
+ ensure => absent,
+ }
+
+ File["${apache::www_folder}/${sympa_subdomain}/wwsympa.fcgi"] {
+ require => undef,
+ }
+}
diff --git a/manifests/virtual.pp b/manifests/virtual.pp
index cf10171..fd1d020 100644
--- a/manifests/virtual.pp
+++ b/manifests/virtual.pp
@@ -1,9 +1,3 @@
-class mail::virtual::params {
- $database_user = 'postfix'
- $database_host = 'localhost'
- $database_name = 'postfix'
-}
-
class mail::virtual(
$database_user = hiera('mail::virtual::database_user', $mail::virtual::params::database_user),
$database_host = hiera('mail::virtual::database_host', $mail::virtual::params::database_host),
@@ -22,7 +16,7 @@ class mail::virtual(
include mail::sasl
include mail::dovecot
- class { [ 'mail::postfixadmin', 'mail::web::virtual' ]: }
+ class { [ 'mail::virtual::database', 'mail::web::virtual' ]: }
# Virtual mailboxes
file { '/var/mail/virtual':
diff --git a/manifests/postfixadmin.pp b/manifests/virtual/database.pp
index a6c87c2..32259a4 100644
--- a/manifests/postfixadmin.pp
+++ b/manifests/virtual/database.pp
@@ -1,4 +1,4 @@
-class mail::postfixadmin {
+class mail::virtual::database {
# Class configuration
case $database_password {
'': { fail("You need to define database_password host config") }
@@ -47,52 +47,52 @@ class mail::postfixadmin {
mode => 0755,
}
- file { "/etc/postfix/sql/mysql_virtual_domains_maps.cf":
+ file { "/etc/virtual/database/mysql_virtual_domains_maps.cf":
ensure => present,
owner => postfix,
mode => 0600,
- content => template('mail/postfix/sql/mysql_virtual_domains_maps.cf.erb'),
- require => File['/etc/postfix/sql'],
+ content => template('mail/virtual/database/mysql_virtual_domains_maps.cf.erb'),
+ require => File['/etc/virtual/database'],
}
- file { "/etc/postfix/sql/mysql_virtual_alias_maps.cf":
+ file { "/etc/virtual/database/mysql_virtual_alias_maps.cf":
ensure => present,
owner => postfix,
mode => 0600,
- content => template('mail/postfix/sql/mysql_virtual_alias_maps.cf.erb'),
- require => File['/etc/postfix/sql'],
+ content => template('mail/virtual/database/mysql_virtual_alias_maps.cf.erb'),
+ require => File['/etc/virtual/database'],
}
- file { "/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf":
+ file { "/etc/virtual/database/mysql_virtual_alias_domain_maps.cf":
ensure => present,
owner => postfix,
mode => 0600,
- content => template('mail/postfix/sql/mysql_virtual_alias_domain_maps.cf.erb'),
- require => File['/etc/postfix/sql'],
+ content => template('mail/virtual/database/mysql_virtual_alias_domain_maps.cf.erb'),
+ require => File['/etc/virtual/database'],
}
- file { "/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf":
+ file { "/etc/virtual/database/mysql_virtual_alias_domain_catchall_maps.cf":
ensure => present,
owner => postfix,
mode => 0600,
- content => template('mail/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf.erb'),
- require => File['/etc/postfix/sql'],
+ content => template('mail/virtual/database/mysql_virtual_alias_domain_catchall_maps.cf.erb'),
+ require => File['/etc/virtual/database'],
}
- file { "/etc/postfix/sql/mysql_virtual_mailbox_maps.cf":
+ file { "/etc/virtual/database/mysql_virtual_mailbox_maps.cf":
ensure => present,
owner => postfix,
mode => 0600,
- content => template('mail/postfix/sql/mysql_virtual_mailbox_maps.cf.erb'),
- require => File['/etc/postfix/sql'],
+ content => template('mail/virtual/database/mysql_virtual_mailbox_maps.cf.erb'),
+ require => File['/etc/virtual/database'],
}
- file { "/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf":
+ file { "/etc/virtual/database/mysql_virtual_alias_domain_mailbox_maps.cf":
ensure => present,
owner => postfix,
mode => 0600,
- content => template('mail/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf.erb'),
- require => File['/etc/postfix/sql'],
+ content => template('mail/virtual/database/mysql_virtual_alias_domain_mailbox_maps.cf.erb'),
+ require => File['/etc/virtual/database'],
}
#
@@ -113,7 +113,7 @@ class mail::postfixadmin {
# ensure => present,
# owner => postfix,
# mode => 0600,
- # content => template('mail/postfix/sql/mysql_virtual_mailbox_limit_maps.cf.erb'),
- # require => File['/etc/postfix/sql'],
+ # content => template('mail/virtual/database/mysql_virtual_mailbox_limit_maps.cf.erb'),
+ # require => File['/etc/virtual/database'],
#}
}
diff --git a/manifests/virtual/packages.pp b/manifests/virtual/packages.pp
new file mode 100644
index 0000000..809115f
--- /dev/null
+++ b/manifests/virtual/packages.pp
@@ -0,0 +1,29 @@
+class mail::virtual::packages {
+ package { [ 'libpam-mysql', 'libgsasl7' ]:
+ ensure => installed,
+ }
+
+ package { [ 'postfix-mysql', 'dovecot-imapd', 'maildrop' ]:
+ ensure => installed,
+ }
+
+ package { [ 'squirrelmail', 'squirrelmail-locales', 'imp4' ]:
+ ensure => installed,
+ }
+
+ package { 'php-crypt-gpg':
+ ensure => installed,
+ }
+
+ # Squeeze (or newer) packages
+ if $::lsbdistcodename != 'lenny' {
+ package { [ 'roundcube', 'roundcube-sqlite', 'roundcube-plugins', 'roundcube-plugins-extra' ]:
+ ensure => latest,
+ }
+ }
+
+ # We'll force SSL through the proxy
+ package { 'squirrelmail-secure-login':
+ ensure => absent,
+ }
+}
diff --git a/manifests/virtual/params.pp b/manifests/virtual/params.pp
new file mode 100644
index 0000000..814b353
--- /dev/null
+++ b/manifests/virtual/params.pp
@@ -0,0 +1,5 @@
+class mail::virtual::params {
+ $database_user = 'postfix'
+ $database_host = 'localhost'
+ $database_name = 'postfix'
+}
diff --git a/manifests/virtual/web.pp b/manifests/virtual/web.pp
new file mode 100644
index 0000000..7c007a9
--- /dev/null
+++ b/manifests/virtual/web.pp
@@ -0,0 +1,73 @@
+class mail::virtual::web(
+ $postfixadmin_setup_hash = hiera('mail::web::virtual::postfixadmin_setup_hash', ''),
+ $roundcube_des_key = hiera('mail::web::virtual::roundcube_des_key', ''),
+ $roundcube_logo = hiera('mail::web::virtual::roundcube_logo', 'null'),
+ $roundcube_login_info = hiera('mail::web::virtual::roundcube_login_info', false)
+) {
+
+ # Class configuration
+ if $::lsbdistcodename != 'lenny' {
+ case $roundcube_des_key {
+ '': { fail("You need to define roundcube_des_key host config") }
+ }
+ }
+
+ case $postfixadmin_setup_hash {
+ '': {
+ warning("You need to define postfixadmin_setup_hash host config")
+ $setup_hash = 'changeme'
+ }
+ }
+
+ include php::imap
+ include websites::setup
+
+ apache::site { "postfixadmin":
+ docroot => "${apache::sites_folder}/postfixadmin/site",
+ use => [ "Site postfixadmin" ],
+ mpm => false,
+ }
+
+ apache::site { "mail":
+ docroot => $::lsbdistcodename ? {
+ 'lenny' => "/usr/share/squirrelmail",
+ default => "/var/lib/roundcube",
+ },
+ source => true,
+ mpm => false,
+ }
+
+ file { "${apache::sites_folder}/postfixadmin/site/config.inc.php":
+ ensure => present,
+ owner => www-data,
+ group => root,
+ mode => 0640,
+ content => template('mail/virtual/postfixadmin/config.inc.php.erb'),
+ require => File["${apache::sites_folder}/postfixadmin/site"],
+ }
+
+ file { "/etc/roundcube/main.inc.php":
+ ensure => $::lsbdistcodename ? {
+ 'lenny' => absent,
+ default => present,
+ },
+ owner => root,
+ group => www-data,
+ mode => 0640,
+ content => template('mail/virtual/roundcube/main.inc.php.erb'),
+ require => Package['roundcube'],
+ }
+
+ file { "/var/lib/roundcube/plugins/login_info":
+ ensure => $::lsbdistcodename ? {
+ 'lenny' => absent,
+ default => directory,
+ },
+ recurse => true,
+ owner => root,
+ group => root,
+ mode => 0644,
+ source => "puppet:///modules/mail/roundcube/plugins/login_info",
+ require => Package['roundcube'],
+ }
+}
diff --git a/manifests/web.pp b/manifests/web.pp
deleted file mode 100644
index 065b44e..0000000
--- a/manifests/web.pp
+++ /dev/null
@@ -1,169 +0,0 @@
-class mail::web::virtual(
- $postfixadmin_setup_hash = hiera('mail::web::virtual::postfixadmin_setup_hash', ''),
- $roundcube_des_key = hiera('mail::web::virtual::roundcube_des_key', ''),
- $roundcube_logo = hiera('mail::web::virtual::roundcube_logo', 'null'),
- $roundcube_login_info = hiera('mail::web::virtual::roundcube_login_info', false)
-) {
-
- # Class configuration
- if $::lsbdistcodename != 'lenny' {
- case $roundcube_des_key {
- '': { fail("You need to define roundcube_des_key host config") }
- }
- }
-
- case $postfixadmin_setup_hash {
- '': {
- warning("You need to define postfixadmin_setup_hash host config")
- $setup_hash = 'changeme'
- }
- }
-
- include php::imap
- include websites::setup
-
- apache::site { "postfixadmin":
- docroot => "${apache::sites_folder}/postfixadmin/site",
- use => [ "Site postfixadmin" ],
- mpm => false,
- }
-
- apache::site { "mail":
- docroot => $::lsbdistcodename ? {
- 'lenny' => "/usr/share/squirrelmail",
- default => "/var/lib/roundcube",
- },
- source => true,
- mpm => false,
- }
-
- file { "${apache::sites_folder}/postfixadmin/site/config.inc.php":
- ensure => present,
- owner => www-data,
- group => root,
- mode => 0640,
- content => template('mail/postfixadmin/config.inc.php.erb'),
- require => File["${apache::sites_folder}/postfixadmin/site"],
- }
-
- file { "/etc/roundcube/main.inc.php":
- ensure => $::lsbdistcodename ? {
- 'lenny' => absent,
- default => present,
- },
- owner => root,
- group => www-data,
- mode => 0640,
- content => template('mail/roundcube/main.inc.php.erb'),
- require => Package['roundcube'],
- }
-
- file { "/var/lib/roundcube/plugins/login_info":
- ensure => $::lsbdistcodename ? {
- 'lenny' => absent,
- default => directory,
- },
- recurse => true,
- owner => root,
- group => root,
- mode => 0644,
- source => "puppet:///modules/mail/roundcube/plugins/login_info",
- require => Package['roundcube'],
- }
-}
-
-class mail::web::sympa inherits websites::setup {
- apache::site { "${sympa::subdomain}":
- docroot => "${apache::www_folder}/${sympa::subdomain}",
- source => true,
- owner => sympa,
- group => sympa,
- mpm => false,
- }
-
- package { [ 'apache2-suexec', 'libapache2-mod-fcgid' ]:
- ensure => present,
- }
-
- apache::module { "fcgid":
- ensure => present,
- require => Package["libapache2-mod-fcgid"],
- }
-
- apache::module { "suexec":
- ensure => present,
- require => Package["apache2-suexec"],
- }
-
- file { "${apache::www_folder}/${sympa::subdomain}/wwsympa.fcgi":
- ensure => present,
- owner => sympa,
- group => sympa,
- mode => 0550,
- content => "#!/bin/sh\n/usr/lib/cgi-bin/sympa/wwsympa.fcgi\n",
- require => File["${apache::www_folder}/${sympa::subdomain}"],
- }
-}
-
-class mail::web::sympa::disabled inherits mail::web::sympa {
- Apache::Site["$sympa_subdomain"] {
- ensure => absent,
- }
-
- File["${apache::www_folder}/${sympa_subdomain}/wwsympa.fcgi"] {
- require => undef,
- }
-}
-
-class mail::web::mlmmj inherits websites::setup {
- $mlmmj_subdomain = hiera('mlmmj_subdomain')
-
- apache::site { "${mail::mlmmj::subdomain}":
- docroot => "/usr/share/mlmmj-php-web-admin",
- owner => 'mlmmj',
- group => 'mlmmj',
- mpm_user => 'mlmmj',
- mpm_group => 'mlmmj',
- manage_user => false,
- require => Package['mlmmj-php-web-admin'],
- }
-
- package { [ 'mlmmj-php-web', 'mlmmj-php-web-admin' ]:
- ensure => present,
- }
-
- file { '/etc/mlmmj-php-web-admin':
- ensure => directory,
- owner => mlmmj,
- group => mlmmj,
- mode => 0640,
- }
-
- file { '/etc/mlmmj-php-web-admin/htpasswd':
- ensure => present,
- owner => mlmmj,
- group => mlmmj,
- mode => 0640,
- source => [ "puppet:///modules/site_mail/mlmmj/htpasswd",
- "puppet:///modules/mail/mlmmj/htpasswd" ],
- }
-}
-
-class mail::web::mlmmj::disabled inherits mail::web::mlmmj {
- Apache::Site["$mlmmj_subdomain"] {
- ensure => absent,
- }
-
- Package[ 'mlmmj-php-web', 'mlmmj-php-web-admin' ] {
- ensure => absent,
- }
-
- File['/etc/mlmmj-php-web-admin'] {
- ensure => absent,
- force => true,
- }
-
- File['/etc/mlmmj-php-web-admin/htpasswd'] {
- ensure => absent,
- }
-}