notify dbmail

This commit is contained in:
Antonio J. Delgado 2023-08-07 09:15:58 +03:00
parent 4c8219b554
commit 6cec4e68eb
3 changed files with 17 additions and 0 deletions

View file

@ -7,3 +7,8 @@
service:
name: postfix
state: restarted
- name: Restart dbmail-imapd
service:
name: dbmail-imapd
state: restarted

View file

@ -25,6 +25,7 @@
when:
- mail_server_fqdn_ip == node_external_ip
- not cert_file.stat.exists
notify: Restart dbmail-imapd
- name: Show check for main mail server
debug:
@ -38,6 +39,7 @@
section: DBMAIL
option: tls_cert
value: "/etc/letsencrypt/live/{{ mail_server_fqdn }}/cert.pem"
notify: Restart dbmail-imapd
- name: Ensure dbmail certificate's private key is configured
ini_file:
@ -46,6 +48,7 @@
section: DBMAIL
option: tls_key
value: "/etc/letsencrypt/live/{{ mail_server_fqdn }}/privkey.pem"
notify: Restart dbmail-imapd
- name: Ensure dbmail certificate's certificate authority certificate is configured
ini_file:
@ -54,6 +57,7 @@
section: DBMAIL
option: tls_cafile
value: "/etc/letsencrypt/live/{{ mail_server_fqdn }}/chain.pem"
notify: Restart dbmail-imapd
- name: Check if there is a public key
stat:

View file

@ -10,12 +10,14 @@
src: "/usr/src/dbmail-{{ dbmail_version }}/dbmail.conf"
dest: /etc/dbmail/dbmail.conf
backup: yes
notify: Restart dbmail-imapd
- name: Ensure dbmail is configured
template:
src: templates/dbmail.conf.j2
dest: /etc/dbmail/dbmail.conf
backup: yes
notify: Restart dbmail-imapd
- name: Ensure run folder exists
file:
@ -23,6 +25,7 @@
state: directory
owner: "{{ dbmail_configuration['DBMAIL']['effective_user'] | default('dbmail') }}"
group: "{{ dbmail_configuration['DBMAIL']['effective_group'] | default('dbmail') }}"
notify: Restart dbmail-imapd
- name: Ensure driver is configured
ini_file:
@ -31,6 +34,7 @@
section: DBMAIL
option: dburi
value: "{{ dbmail_db_driver }}://{{ dbmail_db_user }}:{{ dbmail_db_password }}@{{ dbmail_db_host }}:{{ dbmail_db_port }}/{{ dbmail_db_name }}"
notify: Restart dbmail-imapd
- name: Make services start infinite for IMAP
ini_file:
@ -38,6 +42,7 @@
section: Service
option: TimeoutStartSec
value: infinity
notify: Reload systemd daemon
- name: Make services start infinite for POP
ini_file:
@ -45,6 +50,7 @@
section: Service
option: TimeoutStartSec
value: infinity
notify: Reload systemd daemon
- name: Make services start infinite for LMTP
ini_file:
@ -52,6 +58,7 @@
section: Service
option: TimeoutStartSec
value: infinity
notify: Reload systemd daemon
- name: Make services start infinite for timsieved
ini_file:
@ -59,6 +66,7 @@
section: Service
option: TimeoutStartSec
value: infinity
notify: Reload systemd daemon
- name: Ensure service units are enabled and started
systemd: