opendkim: restart the service when it fails.

This commit is contained in:
Andrea Dell'Amico 2025-02-19 18:18:46 +01:00
parent caa734d6d3
commit 93b77ba652
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 14 additions and 2 deletions

View File

@ -25,6 +25,7 @@
- name: dkim | DKIM configuration
tags: ['postfix', 'postfix_dkim', 'dkim', 'postfix_conf', 'dkim_conf']
when: postfix_dkim_enabled
block:
- name: dkim | Create the dkim domains subdirs
ansible.builtin.file:
@ -55,7 +56,6 @@
- keytable
- signingtable
notify: restart opendkim
- name: dkim | Install the trustedhosts list when defined
ansible.builtin.template:
src: 'dkim_trustedhosts.j2'
@ -65,7 +65,15 @@
mode: "0600"
notify: restart opendkim
when: postfix_dkim_trusted_hosts_enabled
- name: dkim | Install a systemd service override for opendkim
ansible.builtin.template:
src: 'opendkim.service-override.j2'
dest: '/etc/systemd/system/opendkim.service.d/override.conf'
owner: root
group: root
mode: "0644"
notify: restart opendkim
when: ansible_distribution_file_variety == "RedHat"
- name: dkim | Install the opendkim configuration
ansible.builtin.template:
src: opendkim.conf.j2

View File

@ -0,0 +1,4 @@
[Service]
RestartSec=10
Restart=on-failure
StartLimitBurst=5