Configure Roundcube on community
[cacert-puppet.git] / sitemodules / profiles / manifests / roundcube.pp
1 # Class: profiles::roundcube
2 # ==========================
3 #
4 # This class installs and configures the roundcube webmail system.
5 #
6 # Parameters
7 # ----------
8 #
9 # des_key Key to encrypt the the client cookies, must be exactly 24
10 # characters long
11 #
12 # email_host Hostname of the email server
13 #
14 # mail_domain Mail domain used to find matching user names from client
15 # certificate Email SubjectAlternativeName extensions
16 #
17 # master_password IMAP server master password used for client certificate
18 # authentication
19 #
20 # Examples
21 # --------
22 #
23 # @example
24 # class roles::myhost {
25 # include profiles::roundcube
26 # }
27 #
28 # Authors
29 # -------
30 #
31 # Jan Dittberner <jandd@cacert.org>
32 #
33 # Copyright
34 # ---------
35 #
36 # Copyright 2019 Jan Dittberner
37 class profiles::roundcube (
38 String $des_key,
39 String $email_host = 'email.infra.cacert.org',
40 String $mail_domain = 'cacert.org',
41 String $master_password,
42 ) {
43 include profiles::cacert_debrepo
44
45 package { 'mariadb-server':
46 ensure => latest,
47 }
48
49 package { ['dbconfig-mysql', 'php-zip', 'php-gd', 'libapache2-mod-php', 'roundcube', 'roundcube-plugins', 'roundcube-mysql', 'roundcube-plugin-clientcert-authentication']:
50 ensure => latest,
51 }
52
53 file { '/etc/roundcube/config.inc.php':
54 ensure => file,
55 owner => 'root',
56 group => 'www-data',
57 mode => '0640',
58 content => epp('profiles/roundcube/config.inc.php.epp', {
59 des_key => $des_key,
60 email_host => $email_host,
61 plugins => ['clientcert_authentication', 'managesieve'],
62 skin => 'larry',
63 smtp_port => 587,
64 support_url => 'https://bugs.cacert.org/set_project.php?project_id=18;30',
65 },
66 require => [
67 Package['roundcube-core'],
68 Package['roundcube-plugins'],
69 Package['roundcube-plugin-clientcert-authentication'],
70 ],
71 }
72
73 file { '/etc/roundcube/plugins/managesieve/config.inc.php':
74 ensure => file,
75 owner => 'root',
76 group => 'www-data',
77 mode => '0640',
78 content => epp('profiles/roundcube/managesieve-config.inc.php.epp', {
79 },
80 require => Package['roundcube-plugins'],
81 }
82
83 file { '/etc/roundcube/plugins/clientcert_authentication/config.inc.php':
84 ensure => file,
85 owner => 'root',
86 group => 'www-data',
87 mode => '0640',
88 content => epp('profiles/roundcube/clientcert_authentication-config.inc.php.epp', {
89 mail_domain => $mail_domain,
90 master_password => $master_password,
91 },
92 require => Package['roundcube-plugin-clientcert-authentication'],
93 }
94 }