Ei kuvausta
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.

opendkim.yml 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. # Handy reference: http://stevejenkins.com/blog/2010/09/how-to-get-dkim-domainkeys-identified-mail-working-on-centos-5-5-and-postfix-using-opendkim/
  3. - name: Install OpenDKIM and related packages
  4. apt: pkg={{ item }} state=installed
  5. with_items:
  6. - opendkim
  7. - opendkim-tools
  8. tags:
  9. - dependencies
  10. - name: Create OpenDKIM config directory
  11. file: state=directory path=/etc/opendkim group=opendkim owner=opendkim
  12. - name: Create OpenDKIM key directories
  13. file: state=directory path=/etc/opendkim/keys/{{ item.name }} group=opendkim owner=opendkim
  14. with_items: mail_virtual_domains
  15. - name: Generate OpenDKIM keys
  16. command: opendkim-genkey -r -d {{ item.name }} -D /etc/opendkim/keys/{{ item.name }}/ creates=/etc/opendkim/keys/{{ item.name }}/default.private
  17. with_items: mail_virtual_domains
  18. - name: Put opendkim.conf into place
  19. copy: src=etc_opendkim.conf dest=/etc/opendkim.conf owner=opendkim group=opendkim
  20. notify:
  21. - restart opendkim
  22. - restart postfix
  23. - name: Put additional OpenDKIM configuration files into place
  24. template: src=etc_opendkim_{{ item }}.j2 dest=/etc/opendkim/{{ item }} owner=opendkim group=opendkim
  25. with_items:
  26. - KeyTable
  27. - SigningTable
  28. - TrustedHosts
  29. notify:
  30. - restart opendkim
  31. - restart postfix
  32. - name: Set OpenDKIM config directory permissions
  33. file: state=directory path=/etc/opendkim
  34. group=opendkim owner=opendkim mode=0700 recurse=yes
  35. notify:
  36. - restart opendkim
  37. - restart postfix