diff --git a/ispmail.yml b/ispmail.yml index 85398ef..bf8767d 100644 --- a/ispmail.yml +++ b/ispmail.yml @@ -9,5 +9,6 @@ - ispmail-database - ispmail-postfix - ispmail-dovecot - - { role: ispmail-webmail, when: "ispmail_populate_test_data == true" } + - ispmail-webmail + - ispmail-webmail-apache diff --git a/roles/ispmail-webmail/handlers/main.yml b/roles/ispmail-webmail-apache/handlers/main.yml similarity index 100% rename from roles/ispmail-webmail/handlers/main.yml rename to roles/ispmail-webmail-apache/handlers/main.yml diff --git a/roles/ispmail-webmail-apache/tasks/main.yml b/roles/ispmail-webmail-apache/tasks/main.yml new file mode 100644 index 0000000..0f0cc09 --- /dev/null +++ b/roles/ispmail-webmail-apache/tasks/main.yml @@ -0,0 +1,16 @@ +- name: install required binary packages + apt: name={{item}} state=installed + with_items: + - apache2 + - libapache2-mod-php5 + notify: restart apache +- name: Create Apache vhost configuration for Webmail + template: src=webmail.conf.j2 dest=/etc/apache2/sites-available/webmail.conf + notify: restart apache +- name: Enable Apache vhost + command: /usr/sbin/a2ensite webmail.conf creates=/etc/apache2/sites-enabled/webmail.conf + notify: restart apache +- name: Enabling Apache SSL module + command: /usr/sbin/a2enmod ssl creates=/etc/apache2/mods-enabled/ssl.conf + notify: restart apache + diff --git a/roles/ispmail-webmail/tasks/main.yml b/roles/ispmail-webmail/tasks/main.yml index 65b9a16..f014326 100644 --- a/roles/ispmail-webmail/tasks/main.yml +++ b/roles/ispmail-webmail/tasks/main.yml @@ -6,18 +6,6 @@ with_items: - roundcube - roundcube-plugins - - apache2 - - libapache2-mod-php5 - notify: restart apache -- name: Create Apache vhost configuration for Webmail - template: src=webmail.conf.j2 dest=/etc/apache2/sites-available/webmail.conf - notify: restart apache -- name: Enable Apache vhost - command: /usr/sbin/a2ensite webmail.conf creates=/etc/apache2/sites-enabled/webmail.conf - notify: restart apache -- name: Enabling Apache SSL module - command: /usr/sbin/a2enmod ssl creates=/etc/apache2/mods-enabled/ssl.conf - notify: restart apache - name: Creating random des_key for Roundcube shell: pwgen 24 register: roundcube_random_des_key