class mail::sympa( $database_password = hiera('mail::sympa::database_password', ''), $database_name = hiera('mail::sympa::database_name', $mail::sympa::params::database_name), $database_host = hiera('mail::sympa::database_host', $mail::sympa::params::database_host), $listmasters = hiera('mail::sympa::listmasters', $mail::sympa::params::listmasters), $lang = hiera('mail::sympa::lang', $mail::sympa::params::lang), $subdomain = hiera('mail::sympa::subdomain', $mail::sympa::params::subdomain), $logo_html_definition = hiera('mail::sympa::logo_html_definition', $mail::sympa::params::logo_html_definition) ) { # Class configuration case $database_password { '': { fail("You need to define mail::sympa::database_password config") } } # Sympa subsystems include mail::sympa::web include mail::sympa::packages # # Database configuration # database::instance { "${database_name}": password => "${database_password}", privileges => $::lsbdistcodename ? { 'lenny' => 'all', default => [ 'alter_priv', 'alter_routine_priv', 'create_priv', 'create_routine_priv', 'create_tmp_table_priv', 'create_view_priv', 'delete_priv', 'drop_priv', 'event_priv', 'execute_priv', 'grant_priv', 'index_priv', 'insert_priv', 'lock_tables_priv', 'references_priv', 'select_priv', 'show_view_priv', 'trigger_priv', 'update_priv' ], } } group { 'sympa': ensure => present, } user { 'sympa': ensure => present, gid => 'sympa', require => Group['sympa'], } service { "sympa": ensure => running, enable => true, hasstatus => false, pattern => '/usr/lib/sympa/bin/sympa.pl', } file { "/etc/sympa": ensure => directory, owner => postfix, group => root, mode => 0755, } file { "/etc/sympa/sympa.conf": ensure => present, owner => sympa, group => sympa, mode => 0640, content => template("mail/sympa/sympa.conf.${::lsbdistcodename}.erb"), require => [ File['/etc/sympa'], User['sympa'] ], notify => Service['apache', 'sympa'], } file { "/etc/dbconfig-common": ensure => directory, owner => root, group => root, mode => 0755, } file { "/etc/dbconfig-common/sympa.conf": ensure => present, owner => root, group => root, mode => 0600, content => template("mail/sympa/dbconfig-common.${::lsbdistcodename}.erb"), require => File['/etc/dbconfig-common'], } file { "/etc/logrotate.d/sympa": ensure => present, owner => root, group => root, mode => 0644, source => "puppet:///modules/mail/sympa/logrotate", } # gracefully restart sympa everyday cron { "sympa-restart": command => "/etc/init.d/sympa restart > /dev/null 2>&1", user => root, hour => "*/3", minute => "0", ensure => present, require => Service['sympa'], } mail::sympa::domain { "${subdomain}.${domain}": } # TODO: remove in the future postfix::transport_regexp_snippet { "sympa_transport_regexp": ensure => absent, content => template('mail/sympa/transport_regexp.erb'), } # TODO: remove in the future postfix::virtual_regexp_snippet { "sympa_virtual_regexp": ensure => absent, content => template('mail/sympa/virtual_regexp.erb'), } postfix::config { "sympa_destination_recipient_limit": value => '1', nonstandard => true; "sympabounce_destination_recipient_limit": value => '1', nonstandard => true; } mailalias { "sympa": recipient => "|/usr/lib/sympa/bin/queue sympa", notify => Exec["newaliases"], } mailalias { "sympa-request": recipient => "postmaster", notify => Exec["newaliases"], } mailalias { "sympa-owner": recipient => "postmaster", notify => Exec["newaliases"], } mailalias { "listmaster": recipient => "postmaster", notify => Exec["newaliases"], } mailalias { "postmaster": recipient => "root", notify => Exec["newaliases"], } mailalias { "abuse-feedback-report": recipient => "|/usr/lib/sympa/bin/bouncequeue sympa", notify => Exec["newaliases"], } mailalias { "bounce+*": recipient => "|/usr/lib/sympa/bin/bouncequeue sympa", notify => Exec["newaliases"], } # # Listserv compatibility # mailalias { "listserv": recipient => "sympa", notify => Exec["newaliases"], } mailalias { "listserv-request": recipient => "sympa-request", notify => Exec["newaliases"], } mailalias { "listserv-owner": recipient => "sympa-owner", notify => Exec["newaliases"], } mailalias { "majordomo": recipient => "sympa", notify => Exec["newaliases"], } }