2021-01-22 01:09:04 +01:00
|
|
|
---
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Rspamd password generation
|
2021-01-25 01:21:38 +01:00
|
|
|
block:
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Configure rspamd password
|
2021-01-25 01:21:38 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: templates/worker-controller.inc.j2
|
|
|
|
dest: "{{ rspamd__config_path }}worker-controller.inc"
|
|
|
|
mode: '0640'
|
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|
2021-01-25 01:21:38 +01:00
|
|
|
rescue:
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: You have to install passlib
|
2022-04-07 23:10:30 +02:00
|
|
|
ansible.builtin.fail:
|
2021-01-25 01:21:38 +01:00
|
|
|
msg: 'I caught an error. Maybe you have to install passlib via pip3'
|
2021-01-22 01:09:04 +01:00
|
|
|
|
|
|
|
- name: Einstellung des logging
|
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: files/logging.inc
|
|
|
|
dest: "{{ rspamd__config_path }}logging.inc"
|
2021-01-25 00:06:10 +01:00
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2021-01-22 01:09:04 +01:00
|
|
|
mode: '0640'
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|
2021-01-22 01:09:04 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Configure milter_headers.conf
|
2021-01-22 01:09:04 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: files/milter_headers.conf
|
|
|
|
dest: "{{ rspamd__config_path }}milter_headers.conf"
|
2021-01-25 00:06:10 +01:00
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2021-01-22 01:09:04 +01:00
|
|
|
mode: '0640'
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|
2021-01-22 01:09:04 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Configure classifier-bayes.conf
|
2021-01-22 01:09:04 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: files/classifier-bayes.conf
|
|
|
|
dest: "{{ rspamd__config_path }}classifier-bayes.conf"
|
2021-01-25 00:06:10 +01:00
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2021-01-22 01:09:04 +01:00
|
|
|
mode: '0640'
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|
2021-01-22 01:09:04 +01:00
|
|
|
|
|
|
|
- name: Einstellug der redis.conf
|
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: templates/redis.conf.j2
|
|
|
|
dest: "{{ rspamd__config_path }}redis.conf"
|
2021-01-25 00:06:10 +01:00
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2021-01-22 01:09:04 +01:00
|
|
|
mode: '0640'
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|
2021-01-22 01:09:04 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Modify classifier-bayes.conf
|
2021-01-22 01:09:04 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: files/classifier-bayes.conf
|
|
|
|
dest: "{{ rspamd__config_path }}classifier-bayes.conf"
|
2021-01-25 00:06:10 +01:00
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2021-01-22 01:09:04 +01:00
|
|
|
mode: '0640'
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|
2021-01-22 01:09:04 +01:00
|
|
|
|
|
|
|
- name: Einstellug der eignene black/whitelist
|
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "{{ rspamd__multimap_conf_file }}"
|
|
|
|
dest: "{{ rspamd__config_path }}multimap.conf"
|
2021-01-25 00:06:10 +01:00
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2021-01-22 01:09:04 +01:00
|
|
|
mode: '0640'
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|
2021-01-23 00:46:39 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Multimap whitelist_ip.map
|
2021-01-23 00:46:39 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "{{ rspamd__whitelist_ip_file }}"
|
|
|
|
dest: "{{ rspamd__config_path }}whitelist_ip.map"
|
2021-01-25 00:06:10 +01:00
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2021-01-23 00:46:39 +01:00
|
|
|
mode: '0640'
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|
2021-01-23 00:46:39 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Multimap whitelist_from.map
|
2021-01-23 00:46:39 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "{{ rspamd__whitelist_from_file }}"
|
|
|
|
dest: "{{ rspamd__config_path }}whitelist_from.map"
|
2021-01-25 00:06:10 +01:00
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2021-01-23 00:46:39 +01:00
|
|
|
mode: '0640'
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|
2021-01-23 00:46:39 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Multimap blacklist_ip.map
|
2021-01-23 00:46:39 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "{{ rspamd__blacklist_ip_file }}"
|
|
|
|
dest: "{{ rspamd__config_path }}blacklist_ip.map"
|
2021-01-25 00:06:10 +01:00
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2021-01-23 00:46:39 +01:00
|
|
|
mode: '0640'
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|
2021-01-23 00:46:39 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Multimap blacklist_from.map
|
2021-01-23 00:46:39 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "{{ rspamd__blacklist_from_file }}"
|
|
|
|
dest: "{{ rspamd__config_path }}blacklist_from.map"
|
2021-01-25 00:06:10 +01:00
|
|
|
owner: "{{ rspamd__default_owner }}"
|
|
|
|
group: "{{ rspamd__default_group }}"
|
2021-01-23 00:46:39 +01:00
|
|
|
mode: '0640'
|
2023-10-29 15:42:13 +01:00
|
|
|
notify: Run systemctl restart rspamd
|