Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rspamd.yml 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ---
  2. # Installs and configures the Rspamd spam filtering system.
  3. - name: Ensure repository key for Rspamd is in place
  4. apt_key:
  5. url=https://rspamd.com/apt-stable/gpg.key
  6. state=present
  7. tags:
  8. - dependencies
  9. - name: Add Rspamd repository
  10. apt_repository:
  11. repo="deb https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main"
  12. tags:
  13. - dependencies
  14. - name: Install Rspamd and Redis
  15. apt:
  16. name: "{{ packages }}"
  17. state: present
  18. vars:
  19. packages:
  20. - rspamd
  21. - redis-server
  22. tags:
  23. - dependencies
  24. - name: Copy DMARC configuration into place
  25. template:
  26. src=etc_rspamd_local.d_dmarc.conf.j2
  27. dest=/etc/rspamd/local.d/dmarc.conf
  28. owner=root
  29. group=root
  30. mode="0644"
  31. notify: restart rspamd
  32. - name: Configure Rspamd to use Redis
  33. copy:
  34. src=etc_rspamd_local.d_redis.conf
  35. dest=/etc/rspamd/local.d/redis.conf
  36. owner=root
  37. group=root
  38. mode="0644"
  39. notify: restart rspamd
  40. - name: Copy DKIM configuration into place
  41. copy:
  42. src=etc_rspamd_override.d_dkim_signing.conf
  43. dest=/etc/rspamd/override.d/dkim_signing.conf
  44. owner=root
  45. group=root
  46. mode="0644"
  47. notify: restart rspamd
  48. - name: Create dkim key directory
  49. file:
  50. path=/var/lib/rspamd/dkim
  51. state=directory
  52. owner=_rspamd
  53. group=_rspamd
  54. - name: Generate DKIM keys
  55. shell: rspamadm dkim_keygen -s default -d {{ item.name }} -k {{ item.name }}.default.key > {{ item.name }}.default.txt
  56. args:
  57. creates: /var/lib/rspamd/dkim/{{ item.name }}.default.key
  58. chdir: /var/lib/rspamd/dkim/
  59. with_items: "{{ virtual_domains }}"
  60. - name: Start redis
  61. service:
  62. name=redis-server
  63. state=started