ansible-role-mailserver/tasks/roundcubemail.yml

58 lines
1.8 KiB
YAML
Raw Normal View History

2020-07-24 17:07:52 +02:00
- name: roundcubemail - install
package:
name: roundcubemail
state: latest
2020-07-24 18:08:57 +02:00
- name: roundcubemail - create user
postgresql_user:
login_host: "{{ mailserver_roundcubemail_db_host }}"
name: "{{ mailserver_roundcubemail_db_user }}"
password: "{{ mailserver_roundcubemail_db_password }}"
- name: roundcubemail - create database
register: mailserver_roundcubemail_db_create
2020-07-24 18:08:57 +02:00
postgresql_db:
login_host: "{{ mailserver_roundcubemail_db_host }}"
name: "{{ mailserver_roundcubemail_db_name }}"
owner: "{{ mailserver_roundcubemail_db_user }}"
encoding: UTF-8
lc_collate: en_US.UTF-8
lc_ctype: en_US.UTF-8
# TODO maybe notify
2020-07-24 18:08:57 +02:00
- name: roundcubemail - create tables
when: mailserver_roundcubemail_db_create.changed
2020-07-24 18:08:57 +02:00
postgresql_query:
login_host: "{{ mailserver_roundcubemail_db_host }}"
login_user: "{{ mailserver_roundcubemail_db_user }}"
login_password: "{{ mailserver_roundcubemail_db_password }}"
db: "{{ mailserver_roundcubemail_db_name }}"
path_to_script: /usr/share/webapps/roundcubemail/SQL/postgres.initial.sql
2020-07-24 17:07:52 +02:00
- name: roundcubemail - nginx local
notify: reload nginx
2020-07-25 11:53:58 +02:00
#when: mailserver_roundcubemail_domain == ""
2020-07-24 17:07:52 +02:00
template:
src: roundcubemail-local.nginx
dest: /etc/nginx/local.d/roundcubemail.act
2020-07-25 11:53:58 +02:00
- name: roundcube - get cert for nginx domain
notify: dehydrated
when: mailserver_roundcubemail_domain != ""
lineinfile:
path: /etc/dehydrated/domains.txt
line: "{{ mailserver_roundcubemail_domain }}"
- name: roundcubemail - nginx domain
notify: reload nginx
when: mailserver_roundcubemail_domain != ""
template:
src: roundcubemail-domain.nginx
dest: /etc/nginx/sites.d/roundcubemail.act
2020-07-24 17:07:52 +02:00
- name: roundcubemail - config
template:
src: roundcubemail-conf.php
dest: /etc/webapps/roundcubemail/config/config.inc.php