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'], } }