| @@ -2,12 +2,14 @@ ispmail_populate_test_data: true | |||||
| ispmail_mysql_mailuser_password: ChangeMe | ispmail_mysql_mailuser_password: ChangeMe | ||||
| ispmail_mysql_root_password: ChangeMeRoot | ispmail_mysql_root_password: ChangeMeRoot | ||||
| ispmail_mysql_roundcube_password: ChangeMeRound | |||||
| ispmail_dovecot_auth_mechanisms: plain login | ispmail_dovecot_auth_mechanisms: plain login | ||||
| ispmail_postmaster_address: postmaster@example.org | ispmail_postmaster_address: postmaster@example.org | ||||
| ispmail_webmail_hostname: mail.example.org | |||||
| #ispmail_webmail_hostname: mail.example.org | |||||
| ispmail_webmail_hostname: 10.0.0.100 | |||||
| ispmail_certificate_country: DE | ispmail_certificate_country: DE | ||||
| ispmail_certificate_state: Hamburg | ispmail_certificate_state: Hamburg | ||||
| @@ -18,5 +20,3 @@ ispmail_certificate_domains: | |||||
| - example.org | - example.org | ||||
| ispmail_certificate_email: postmaster@example.org | ispmail_certificate_email: postmaster@example.org | ||||
| ispmail_certificate_days_valid: 3650 | ispmail_certificate_days_valid: 3650 | ||||
| ispmail_postmaster_address: postmaster@example.org | |||||
| @@ -5,6 +5,8 @@ | |||||
| # template: src=root-my-cnf.j2 dest=/root/.my.cnf mode=0600 | # template: src=root-my-cnf.j2 dest=/root/.my.cnf mode=0600 | ||||
| - name: creating mailserver MySQL database | - name: creating mailserver MySQL database | ||||
| mysql_db: name=mailserver state=present | mysql_db: name=mailserver state=present | ||||
| - name: creating Roundcube MySQL database | |||||
| mysql_db: name=roundcube state=present | |||||
| - name: copying MySQL database schema to server | - name: copying MySQL database schema to server | ||||
| copy: src=schema.sql dest=/tmp | copy: src=schema.sql dest=/tmp | ||||
| - name: setting up SQL schema of mailserver database | - name: setting up SQL schema of mailserver database | ||||
| @@ -13,9 +15,15 @@ | |||||
| # mysql_user: name=root password={{ispmail_mysql_root_password}} state=present | # mysql_user: name=root password={{ispmail_mysql_root_password}} state=present | ||||
| - name: creating MySQL user to read the mailserver database | - name: creating MySQL user to read the mailserver database | ||||
| mysql_user: name=mailuser password={{ispmail_mysql_mailuser_password}} priv=mailserver.*:SELECT,INSERT,UPDATE,DELETE state=present | mysql_user: name=mailuser password={{ispmail_mysql_mailuser_password}} priv=mailserver.*:SELECT,INSERT,UPDATE,DELETE state=present | ||||
| - name: creating MySQL user for roundcube | |||||
| mysql_user: name=roundcube password={{ispmail_mysql_roundcube_password}} priv=roundcube.*:ALL state=present | |||||
| - name: copying MySQL test data to server | - name: copying MySQL test data to server | ||||
| copy: src=test.sql dest=/tmp | copy: src=test.sql dest=/tmp | ||||
| when: ispmail_populate_test_data == true | when: ispmail_populate_test_data == true | ||||
| - name: populating the database with test data | - name: populating the database with test data | ||||
| mysql_db: name=mailserver state=import target=/tmp/test.sql | mysql_db: name=mailserver state=import target=/tmp/test.sql | ||||
| when: ispmail_populate_test_data == true | when: ispmail_populate_test_data == true | ||||
| # - name: set the MySQL root user's password | |||||
| # mysql_user: name=root password={{ispmail_mysql_root_password}} state=present | |||||
| # - name: Create root's .my.cnf | |||||
| # template: src=my-cnf.j2 dest=/root/.my.cnf mode=0600 | |||||
| @@ -0,0 +1,2 @@ | |||||
| [client] | |||||
| password={{ispmail_mysql_root_password}} | |||||
| @@ -1,16 +1,18 @@ | |||||
| - name: install required binary packages | |||||
| - name: Install required binary packages | |||||
| apt: name={{item}} state=installed | apt: name={{item}} state=installed | ||||
| with_items: | with_items: | ||||
| - apache2 | - apache2 | ||||
| - libapache2-mod-php5 | - libapache2-mod-php5 | ||||
| notify: restart apache | notify: restart apache | ||||
| - name: Create Apache vhost configuration for Webmail | |||||
| template: src=webmail.conf.j2 dest=/etc/apache2/sites-available/webmail.conf | |||||
| - name: Create Apache vhost configuration for HTTPS (RoundCube and PHPmyadmin) | |||||
| template: src=webmail.conf-443.j2 dest=/etc/apache2/sites-available/default-ssl.conf | |||||
| notify: restart apache | notify: restart apache | ||||
| - name: Enable Apache vhost | |||||
| command: /usr/sbin/a2ensite webmail.conf creates=/etc/apache2/sites-enabled/webmail.conf | |||||
| - name: Enable Apache vhost for HTTPS | |||||
| command: /usr/sbin/a2ensite default-ssl creates=/etc/apache2/sites-enabled/default-ssl.conf | |||||
| notify: restart apache | notify: restart apache | ||||
| - name: Enabling Apache SSL module | |||||
| - name: Create Apache vhost configuration for HTTP (redirect to HTTPS) | |||||
| template: src=webmail.conf-80.j2 dest=/etc/apache2/sites-available/000-default.conf | |||||
| notify: restart apache | |||||
| - name: Enable Apache SSL module | |||||
| command: /usr/sbin/a2enmod ssl creates=/etc/apache2/mods-enabled/ssl.conf | command: /usr/sbin/a2enmod ssl creates=/etc/apache2/mods-enabled/ssl.conf | ||||
| notify: restart apache | notify: restart apache | ||||
| @@ -1,11 +1,10 @@ | |||||
| <IfModule mod_ssl.c> | <IfModule mod_ssl.c> | ||||
| <VirtualHost _default_:443> | <VirtualHost _default_:443> | ||||
| ServerAdmin webmaster@localhost | |||||
| ServerAdmin {{ ispmail_postmaster_address }} | |||||
| ServerName {{ ispmail_webmail_hostname }} | ServerName {{ ispmail_webmail_hostname }} | ||||
| #DocumentRoot /var/www/html | |||||
| Include /etc/roundcube/apache.conf | Include /etc/roundcube/apache.conf | ||||
| Alias /roundcube /var/lib/roundcube | |||||
| Alias / /var/lib/roundcube/ | |||||
| # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, | ||||
| # error, crit, alert, emerg. | # error, crit, alert, emerg. | ||||
| @@ -0,0 +1,6 @@ | |||||
| <VirtualHost *:80> | |||||
| ServerAdmin {{ ispmail_postmaster_address }} | |||||
| ServerName {{ ispmail_webmail_hostname }} | |||||
| Redirect permanent / https://{{ ispmail_webmail_hostname}}/ | |||||
| </VirtualHost> | |||||
| @@ -17,4 +17,5 @@ | |||||
| template: src=roundcube-password-config.inc.php.j2 dest=/etc/roundcube/plugins/password/config.inc.php owner=root group=www-data mode=640 | template: src=roundcube-password-config.inc.php.j2 dest=/etc/roundcube/plugins/password/config.inc.php owner=root group=www-data mode=640 | ||||
| - name: Copy ISPmail logo | - name: Copy ISPmail logo | ||||
| copy: src=ispmail-logo.png dest=/var/lib/roundcube/ | copy: src=ispmail-logo.png dest=/var/lib/roundcube/ | ||||
| - name: Copy Roundcube database config file | |||||
| template: src=roundcube-debian-db.php.j2 dest=/etc/roundcube/debian-db.php mode=0640 | |||||
| @@ -0,0 +1,8 @@ | |||||
| <?php | |||||
| $dbuser='roundcube'; | |||||
| $dbpass='{{ispmail_mysql_roundcube_password}}'; | |||||
| $basepath=''; | |||||
| $dbname='roundcube'; | |||||
| $dbserver=''; | |||||
| $dbport=''; | |||||
| $dbtype='mysql'; | |||||