Puppet Class: roundcube::config
- Inherits:
- roundcube
- Defined in:
- manifests/config.pp
Overview
Class: roundcube::config
Manage the Roundcube configuration files.
Copyright
Copyright 2015 Martin Meinhold, unless otherwise noted.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'manifests/config.pp', line 9
class roundcube::config inherits roundcube {
$application_dir = $roundcube::install::target
$config_file = "${application_dir}/config/config.inc.php"
if empty($roundcube::db_dsn) {
$password = uriescape($roundcube::db_password)
$db_dsnw = "${roundcube::db_type}://${roundcube::db_username}:${password}@${roundcube::db_host}/${roundcube::db_name}"
}
else {
$db_dsnw = $roundcube::db_dsn
}
$options_defaults = {
'db_dsnw' => $db_dsnw,
'default_host' => $roundcube::imap_host,
'default_port' => $roundcube::imap_port,
'des_key' => $roundcube::des_key,
}
$options = merge($options_defaults, $roundcube::options_hash)
concat { $config_file:
owner => $roundcube::process,
group => $roundcube::process,
mode => '0440',
}
Concat::Fragment {
target => $config_file,
}
if empty($roundcube::config_file_template) {
concat::fragment { "${config_file}__header":
content => template('roundcube/config/header.php.erb'),
order => '10',
}
if !empty($options) {
concat::fragment { "${config_file}__options":
content => template('roundcube/config/options.php.erb'),
order => '20',
}
}
}
else {
concat::fragment { "${config_file}__header":
content => template($roundcube::config_file_template),
order => '10',
}
}
concat::fragment { "${config_file}__plugins_head":
content => "\$config[\'plugins\'] = array(\n",
order => '50',
}
concat::fragment { "${config_file}__plugins_tail":
content => ");\n",
order => '60',
}
roundcube::plugin { $roundcube::plugins: }
file { '/etc/cron.daily/roundcube-cleandb':
ensure => absent,
}
cron { 'roundcube-cleandb':
ensure => present,
command => "${application_dir}/bin/cleandb.sh > /dev/null",
user => 'root',
hour => fqdn_rand(24),
minute => fqdn_rand(60),
}
}
|