spamassin: Use spamd starting with Bookworm

This commit is contained in:
David Prevot 2023-12-11 11:05:06 +01:00
parent b0992bcaf9
commit 5f158e031b
2 changed files with 37 additions and 0 deletions

View file

@ -3,3 +3,8 @@
ansible.builtin.service:
name: spamassassin
state: restarted
- name: restart spamd
ansible.builtin.service:
name: spamd
state: restarted

View file

@ -4,6 +4,16 @@
name:
- spamassassin
state: present
when: ansible_distribution_major_version is version('12', '<')
tags:
- spamassassin
- name: install spamd
ansible.builtin.apt:
name:
- spamd
state: present
when: ansible_distribution_major_version is version('12', '>=')
tags:
- spamassassin
@ -13,6 +23,17 @@
dest: /etc/spamassassin/local_evolix.cf
mode: "0644"
notify: restart spamassassin
when: ansible_distribution_major_version is version('12', '<')
tags:
- spamassassin
- name: configure spamd
ansible.builtin.copy:
src: spamassassin.cf
dest: /etc/spamassassin/local_evolix.cf
mode: "0644"
notify: restart spamd
when: ansible_distribution_major_version is version('12', '>=')
tags:
- spamassassin
@ -22,6 +43,7 @@
regexp: 'ENABLED=0'
replace: 'ENABLED=1'
notify: restart spamassassin
when: ansible_distribution_major_version is version('12', '<')
tags:
- spamassassin
@ -97,5 +119,15 @@
name: spamassassin
state: started
enabled: True
when: ansible_distribution_major_version is version('12', '<')
tags:
- spamassassin
- name: ensure spamd is started and enabled
ansible.builtin.systemd:
name: spamd
state: started
enabled: True
when: ansible_distribution_major_version is version('12', '>=')
tags:
- spamassassin