dkim.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. - name: 'Install opendkim packages'
  2. apt:
  3. pkg: '{{ item }}'
  4. install_recommends: 'no'
  5. state: 'installed'
  6. with_items:
  7. - 'opendkim'
  8. - name: 'Install opendkim main configuration'
  9. template:
  10. src: 'opendkim/opendkim.conf.j2'
  11. dest: '/etc/opendkim.conf'
  12. owner: 'root'
  13. group: 'opendkim'
  14. mode: '0640'
  15. notify:
  16. - 'Restart opendkim'
  17. - name: 'Create opendkim config directory'
  18. file:
  19. path: '/etc/opendkim'
  20. state: 'directory'
  21. owner: 'root'
  22. group: 'opendkim'
  23. mode: '0750'
  24. - name: 'Install opendkim KeyTable'
  25. template:
  26. src: 'opendkim/KeyTable.j2'
  27. dest: '/etc/opendkim/KeyTable'
  28. owner: 'root'
  29. group: 'opendkim'
  30. mode: '0640'
  31. notify:
  32. - 'Restart opendkim'
  33. - name: 'Install opendkim SigningTable'
  34. template:
  35. src: 'opendkim/SigningTable.j2'
  36. dest: '/etc/opendkim/SigningTable'
  37. owner: 'root'
  38. group: 'opendkim'
  39. mode: '0640'
  40. notify:
  41. - 'Restart opendkim'
  42. - name: 'Install opendkim InternalHosts'
  43. template:
  44. src: 'opendkim/InternalHosts.j2'
  45. dest: '/etc/opendkim/InternalHosts'
  46. owner: 'root'
  47. group: 'opendkim'
  48. mode: '0640'
  49. notify:
  50. - 'Restart opendkim'
  51. - name: 'Install DKIM private keys'
  52. copy:
  53. content: "{{lookup('file', 'data/dkim/' + item + '.pem')}}"
  54. dest: '/etc/opendkim/{{ item }}_default.pem'
  55. owner: 'root'
  56. group: 'opendkim'
  57. mode: '0640'
  58. with_items: '{{ dkim_domains }}'
  59. when: dkim_domains