설명 없음
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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 -b 1024 -s mail -d {{ item.name }} -k {{ item.name }}.mail.key > {{ item.name }}.mail.txt
  56. args:
  57. creates: /var/lib/rspamd/dkim/{{ item.name }}.mail.key
  58. chdir: /var/lib/rspamd/dkim/
  59. with_items: "{{ virtual_domains }}"
  60. notify: restart rspamd
  61. - name: Start redis
  62. service:
  63. name=redis-server
  64. state=started