123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- ---
- # 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
- tags:
- - dependencies
-
- - name: Add Rspamd repository
- apt_repository:
- repo="deb https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main"
- tags:
- - dependencies
-
- - name: Install Rspamd and Redis
- apt:
- name: "{{ packages }}"
- state: present
- vars:
- packages:
- - rspamd
- - redis-server
- 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: Configure Rspamd to use Redis
- copy:
- src=etc_rspamd_local.d_redis.conf
- dest=/etc/rspamd/local.d/redis.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: "{{ virtual_domains }}"
-
- - name: Start redis
- service:
- name=redis-server
- state=started
|