Browse Source

Properly generate a PHP /etc/roundcube/debian-db.php file

Justin Plock 10 years ago
parent
commit
00b263608e
No account linked to committer's email address

+ 0
- 4
roles/webmail/handlers/main.yml View File

@@ -1,7 +1,3 @@
1
-- name: reconfigure roundcube db
2
-  command: /usr/sbin/dbconfig-generate-include /etc/dbconfig-common/roundcube.conf /etc/roundcube/debian-db.php
3
-  notify: set roundcube password
4
-
5 1
 - name: set roundcube password
6 2
   command: sudo -u {{ db_admin_username }} psql -d {{ webmail_db_database }} -c "ALTER USER {{ webmail_db_username }} with password '{{ webmail_db_password }}';"
7 3
   notify: import sql carddav

+ 13
- 14
roles/webmail/tasks/roundcube.yml View File

@@ -6,8 +6,11 @@
6 6
     - roundcube-pgsql
7 7
 
8 8
 - name: Configure Roundcube database
9
-  template: src=etc_dbconfig-common_roundcube.conf.j2 dest=/etc/dbconfig-common/roundcube.conf group=root owner=root force=yes
10
-  notify: reconfigure roundcube db
9
+  template: src={{ item.src }} dest={{ item.dest }} group=root owner=root force=yes
10
+  with_items:
11
+  - { src: 'etc_dbconfig-common_roundcube.conf.j2', dest: '/etc/dbconfig-common/roundcube.conf' }
12
+  - { src: 'etc_roundcube_debian-db.php.j2',        dest: '/etc/roundcube/debian-db.php' }
13
+  notify: set roundcube password
11 14
 
12 15
 - name: Download carddav plugin release
13 16
   get_url:
@@ -23,23 +26,19 @@
23 26
 - name: Link carddav plugin into /var/lib/roundcube/plugins
24 27
   file: state=link src=/usr/share/roundcube/plugins/carddav dest=/var/lib/roundcube/plugins/carddav force=yes
25 28
 
26
-- name: Remove downloaded carddav plugin file
27
-  file: state=absent path=/root/carddav_{{ carddav_version }}.tar.gz
29
+#- name: Remove downloaded carddav plugin file
30
+#  file: state=absent path=/root/carddav_{{ carddav_version }}.tar.gz
28 31
 
29 32
 - name: Configure the Apache HTTP server for roundcube
30 33
   template: src=etc_apache2_sites-available_roundcube.j2 dest=/etc/apache2/sites-available/roundcube group=www-data owner=www-data force=yes
31 34
 
32 35
 - name: Configure roundcube
33
-  copy: src=etc_roundcube_main.inc.php dest=/etc/roundcube/main.inc.php group=www-data owner=root mode=640 force=yes
34
-
35
-- name: Configure roundcube's managesieve plugin
36
-  copy: src=usr_share_roundcube_plugins_managesieve_config.inc.php dest=/usr/share/roundcube/plugins/managesieve/config.inc.php group=www-data owner=root mode=640 force=yes
37
-
38
-- name: Configure roundcube's carddav plugin
39
-  copy: src=usr_share_roundcube_plugins_carddav_config.inc.php dest=/usr/share/roundcube/plugins/carddav/config.inc.php group=www-data owner=root mode=640 force=yes
40
-
41
-- name: Copy global default sieve rules
42
-  copy: src=etc_roundcube_global.sieve dest=/etc/roundcube/global.sieve owner=root group=www-data mode=640
36
+  copy: src={{ item.src }} dest={{ item.dest }} group=www-data owner=root mode=640 force=yes
37
+  with_items:
38
+  - { src: 'etc_roundcube_main.inc.php',                             dest: '/etc/roundcube/main.inc.php' }
39
+  - { src: 'usr_share_roundcube_plugins_managesieve_config.inc.php', dest: '/usr/share/roundcube/plugins/managesieve/config.inc.php' }
40
+  - { src: 'usr_share_roundcube_plugins_carddav_config.inc.php',     dest: '/usr/share/roundcube/plugins/carddav/config.inc.php' }
41
+  - { src: 'etc_roundcube_global.sieve',                             dest: '/etc/roundcube/global.sieve' }
43 42
 
44 43
 - name: Enable roundcube site
45 44
   command: a2ensite roundcube creates=/etc/apache2/sites-enabled/roundcube

+ 19
- 0
roles/webmail/templates/etc_roundcube_debian-db.php.j2 View File

@@ -0,0 +1,19 @@
1
+<?php
2
+##
3
+## database access settings in php format
4
+## automatically generated from /etc/dbconfig-common/roundcube.conf
5
+## by /usr/sbin/dbconfig-generate-include
6
+## Mon, 10 Mar 2014 00:42:39 +0000
7
+##
8
+## by default this file is managed via ucf, so you shouldn't have to
9
+## worry about manual changes being silently discarded.  *however*,
10
+## you'll probably also want to edit the configuration file mentioned
11
+## above too.
12
+##
13
+$dbuser='{{ webmail_db_username }}';
14
+$dbpass='{{ webmail_db_password }}';
15
+$basepath='';
16
+$dbname='{{ webmail_db_database }}';
17
+$dbserver='';
18
+$dbport='';
19
+$dbtype='pgsql';

Loading…
Cancel
Save