dkim.yml 1.6 KB

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