dkim.yml 1.6 KB

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