2020-07-20 09:46:16 +02:00
|
|
|
---
|
|
|
|
- name: Install rspamd
|
|
|
|
package:
|
|
|
|
state: latest
|
|
|
|
name:
|
|
|
|
- rspamd
|
2020-07-22 23:56:53 +02:00
|
|
|
- redis
|
|
|
|
|
|
|
|
- name: rspamd - start and enable redis on boot
|
|
|
|
systemd:
|
|
|
|
name: redis
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
|
|
|
|
- name: rspamd - create config folder
|
2020-07-23 21:07:09 +02:00
|
|
|
notify: restart rspamd
|
2020-07-22 23:56:53 +02:00
|
|
|
file:
|
|
|
|
path: /etc/rspamd/local.d
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: rspamd - config
|
2020-07-23 21:07:09 +02:00
|
|
|
notify: restart rspamd
|
2020-07-22 23:56:53 +02:00
|
|
|
template:
|
|
|
|
src: "rspamd/{{ item }}"
|
|
|
|
dest: "/etc/rspamd/local.d/{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- arc.conf
|
|
|
|
- classifier-bayes.conf
|
|
|
|
- dkim_signing.conf
|
|
|
|
- milter_headers.conf
|
|
|
|
- redis.conf
|
2020-07-23 21:07:09 +02:00
|
|
|
|
|
|
|
- name: rspamd - set webui password
|
|
|
|
notify: restart rspamd
|
|
|
|
when: mailserver_rspamd_webui_password is defined
|
|
|
|
template:
|
|
|
|
src: rspamd/worker-controller.inc
|
|
|
|
dest: /etc/rspamd/local.d/worker-controller.inc
|
2020-07-22 23:56:53 +02:00
|
|
|
|
|
|
|
- name: rspamd - install sieve
|
|
|
|
copy:
|
|
|
|
src: "rspamd/{{ item }}"
|
|
|
|
dest: "/srv/mail/sieve/{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- learn-ham.sieve
|
|
|
|
- learn-spam.sieve
|
|
|
|
|
2020-07-23 21:07:09 +02:00
|
|
|
- name: rspamd - nginx local
|
|
|
|
notify: reload nginx
|
|
|
|
when: mailserver_rspamd_domain == ""
|
|
|
|
template:
|
|
|
|
src: rspamd-local.nginx
|
|
|
|
dest: /etc/nginx/local.d/rspamd.act
|
|
|
|
|
2020-07-22 23:56:53 +02:00
|
|
|
- name: rspamd - start and enable on boot
|
|
|
|
systemd:
|
|
|
|
name: rspamd
|
|
|
|
enabled: yes
|
|
|
|
state: started
|