1
2
3
4
5
6
7
8
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
# File 'manifests/roundcubeweb.pp', line 1
class roundcube::roundcubeweb (
$apt_mirror = $roundcube::params::apt_mirror,
$confdir = $roundcube::params::confdir,
$database_host = $roundcube::params::database_host,
$database_name = $roundcube::params::database_name,
$database_password = $roundcube::params::database_password,
$database_port = $roundcube::params::database_port,
$database_ssl = $roundcube::params::database_ssl,
$database_username = $roundcube::params::database_username,
$default_host = $roundcube::params::default_host,
$des_key = $roundcube::params::des_key,
$force_https = $roundcube::params::force_https,
$imap_auth_type = $roundcube::params::imap_auth_type,
$listen_addresses = $roundcube::params::postgres_listen_address,
$log_logins = $roundcube::params::log_logins,
$main_inc_php_erb = $roundcube::params::main_inc_php_erb,
$plugins = $roundcube::params::plugins,
$reconfigure_command = $roundcube::params::reconfigure_command,
$roundcube_backend = $roundcube::params::roundcube_backend,
$roundcube_webserver = $roundcube::params::roundcube_webserver,
$skin = $roundcube::params::skin,
$smtp_server = $roundcube::params::smtp_server,
$smtp_port = $roundcube::params::smtp_port,
$smtp_user = $roundcube::params::smtp_user,
$smtp_pass = $roundcube::params::smtp_pass,
$smtp_auth_type = $roundcube::params::smtp_auth_type,
$spellcheck_engine = $roundcube::params::spellcheck_engine,
$spellcheck_languages = $roundcube::params::spellcheck_languages,
$timezone = $roundcube::params::timezone,
) inherits roundcube::params {
$packagelist = ['roundcube', 'roundcube-core', 'roundcube-plugins']
if $spellcheck_engine == 'aspell' {
class { '::roundcube::spellchecker::aspell':
languagelist => $spellcheck_languages
}
}
apt::source { 'wheezy-backports':
location => $apt_mirror,
repos => 'main',
}
apt::pin { 'roundcube':
packages => 'roundcube*',
priority => 1001,
release => 'wheezy-backports',
}
package { "roundcube-${roundcube_backend}":
ensure => installed,
}
package { $packagelist:
ensure => installed,
require => Package["roundcube-${roundcube_backend}"],
}
#Set the defaults
Ini_setting {
path => '/etc/dbconfig-common/roundcube.conf',
ensure => present,
section => '',
notify => Exec['reconfigure_roundcube'],
require => Package['roundcube-core'],
}
# TODO: figure out some way to make sure that the ini_file module is installed,
# because otherwise these will silently fail to do anything.
ini_setting {'dbtype':
setting => 'dbc_dbtype',
value => "'${roundcube_backend}'",
}
ini_setting {'dbuser':
setting => 'dbc_dbuser',
value => "'${database_username}'",
}
ini_setting {'dbpass':
setting => 'dbc_dbpass',
value => "'${database_password}';",
}
ini_setting {'dbname':
setting => 'dbc_dbname',
value => "'${database_name}';",
}
ini_setting {'dbserver':
setting => 'dbc_dbserver',
value => "'${database_host}';",
}
ini_setting {'dbport':
setting => 'dbc_dbport',
value => "'${database_port}';",
}
ini_setting {'dbssl':
setting => 'dbc_ssl',
value => "'${database_ssl}';",
}
exec { 'reconfigure_roundcube':
refreshonly => true,
command => "${reconfigure_command} roundcube-core",
}
file { "${confdir}/main.inc.php":
owner => root,
group => www-data,
mode => '0640',
content => template($main_inc_php_erb),
}
}
|