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.

71 lines
1.5KB

  1. ---
  2. - name: install packages
  3. apt:
  4. pkg:
  5. - postfix
  6. - name: mailname
  7. copy:
  8. content: "{{mailname}}"
  9. dest: /etc/mailname
  10. notify: reload postfix
  11. - name: master configuration
  12. template:
  13. src: master.cf.j2
  14. dest: /etc/postfix/master.cf
  15. notify: restart postfix
  16. - name: main configuration
  17. template:
  18. src: main.cf.j2
  19. dest: /etc/postfix/main.cf
  20. notify: reload postfix
  21. - name: postfix transport_maps
  22. template:
  23. src: transport_maps.j2
  24. dest: /etc/postfix/transport_maps
  25. notify: postmap transport_maps
  26. - name: postfix virtual_alias_domains
  27. template:
  28. src: virtual_alias_domains.j2
  29. dest: /etc/postfix/virtual_alias_domains
  30. notify: postmap virtual_alias_domains
  31. - name: postfix virtual_alias_maps
  32. template:
  33. src: virtual_alias_maps.j2
  34. dest: /etc/postfix/virtual_alias_maps
  35. notify: postmap virtual_alias_maps
  36. - name: postfix virtual_mailbox_domains
  37. template:
  38. src: virtual_mailbox_domains.j2
  39. dest: /etc/postfix/virtual_mailbox_domains
  40. notify: postmap virtual_mailbox_domains
  41. - name: postfix virtual_mailbox_maps
  42. template:
  43. src: virtual_mailbox_maps.j2
  44. dest: /etc/postfix/virtual_mailbox_maps
  45. notify: postmap virtual_mailbox_maps
  46. - import_tasks: spf.yaml
  47. when: postfix_check_spf
  48. - import_tasks: opendkim.yaml
  49. when: postfix_with_opendkim
  50. - import_tasks: opendmarc.yaml
  51. when: postfix_with_opendmarc
  52. - import_tasks: postfixadmin.yml
  53. when: postfix_method == "postfixadmin"
  54. - name: check postfix configuration
  55. command: postfix check
  56. changed_when: false