openarc: add a options file. Restart when failed.

This commit is contained in:
Andrea Dell'Amico 2025-02-19 18:04:48 +01:00
parent f24b5aaa98
commit caa734d6d3
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
4 changed files with 34 additions and 0 deletions

View File

@ -144,6 +144,7 @@ postfix_arc_mode: 'v'
postfix_arc_socket: 'inet:8894@localhost'
postfix_arc_milter_socket: 'inet:[127.0.0.1]:8894'
postfix_arc_canonicalization: 'relaxed/relaxed'
postfix_opnarc_startup_options: "-l -r"
# SRS
# Compute it with 'dd if=/dev/urandom bs=18 count=1 2>/dev/null | base64'

View File

@ -25,6 +25,7 @@
- name: arc | ARC configuration
tags: ['postfix', 'postfix_arc', 'arc', 'postfix_conf', 'arc_conf']
when: postfix_arc_enabled
block:
- name: arc | Ensure that the /var/run/openarc directory exists
ansible.builtin.file:
@ -67,6 +68,33 @@
group: root
mode: "0644"
notify: Restart openarc
- name: arc | Install the openarc startup options file
ansible.builtin.template:
src: openarc.defaults.j2
dest: /etc/sysconfig/openarc
owner: root
group: root
mode: "0644"
notify: Restart openarc
when: ansible_distribution_file_variety == "RedHat"
- name: arc | Create the drop in directory for the openarc service
ansible.builtin.file:
dest: /etc/systemd/system/openarc.service.d
state: directory
mode: "0755"
owner: root
group: root
notify: Restart openarc
when: ansible_distribution_file_variety == "RedHat"
- name: arc | Install the openarc service drop in configuration
ansible.builtin.template:
src: openarc.service-override.j2
dest: /etc/systemd/system/openarc.service.d/override.conf
owner: root
group: root
mode: "0644"
notify: Restart openarc
when: ansible_distribution_file_variety == "RedHat"
- name: arc | Manage the arc service
tags: ['postfix', 'postfix_arc', 'arc']

View File

@ -0,0 +1 @@
OPTIONS={{ postfix_opnarc_startup_options }}

View File

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