aboutsummaryrefslogtreecommitdiffstats
path: root/roles/mailserver/tasks/rspamd.yml
blob: 4d870a8ae86b5b86fe5a0ac5b534272963257073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
# Installs and configures the Rspamd spam filtering system.

- name: Ensure repository key for Rspamd is in place
  apt_key: url=https://rspamd.com/apt-stable/gpg.key state=present
  when: ansible_architecture != "armv7l"
  tags:
    - dependencies

- name: Ensure yunohost repository key for Rspamd is in place for ARM
  apt_key: url=http://repo.yunohost.org/debian/yunohost.asc state=present
  when: ansible_architecture == "armv7l"
  tags:
    - dependencies

- name: Add Rspamd repository
  apt_repository: repo="deb https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main"
  when: ansible_architecture != "armv7l"
  tags:
    - dependencies

- name: Add yunohost Rspamd repository for ARM
  apt_repository: repo="deb http://repo.yunohost.org/debian {{ ansible_distribution_release }} stable"
  when: ansible_architecture == "armv7l"
  tags:
    - dependencies

- name: Install Rspamd and Redis
  apt: pkg={{ item }} state=installed update_cache=yes
  with_items:
    - rspamd
  tags:
    - dependencies

#- name: Copy DMARC configuration into place
#  template: src=etc_rspamd_local.d_dmarc.conf.j2 dest=/etc/rspamd/local.d/dmarc.conf owner=root group=root mode="0644"
#  notify: restart rspamd

#- name: Copy DKIM configuration into place
#  copy: src=etc_rspamd_override.d_dkim_signing.conf dest=/etc/rspamd/override.d/dkim_signing.conf owner=root group=root mode="0644"
#  notify: restart rspamd

#- name: Create dkim key directory
#  file: path=/var/lib/rspamd/dkim state=directory owner=_rspamd group=_rspamd

#- name: Generate DKIM keys
#  shell: rspamadm dkim_keygen -s default -d {{ item.name }} -k {{ item.name }}.default.key > {{ item.name }}.default.txt
#  args:
#    creates: /var/lib/rspamd/dkim/{{ item.name }}.default.key
#    chdir: /var/lib/rspamd/dkim/
#  with_items: "{{ mail_virtual_domains }}"