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.

54 lines
1.0KB

  1. ---
  2. - name: install packages
  3. apt:
  4. pkg:
  5. - postfix
  6. - name: master configuration
  7. template:
  8. src: master.cf.j2
  9. dest: /etc/postfix/master.cf
  10. notify: restart postfix
  11. - name: main configuration
  12. template:
  13. src: main.cf.j2
  14. dest: /etc/postfix/main.cf
  15. notify: reload postfix
  16. - name: mailname
  17. copy:
  18. content: "{{mailname}}"
  19. dest: /etc/mailname
  20. notify: reload postfix
  21. - import_tasks: spf.yaml
  22. when: postfix_check_spf
  23. - import_tasks: opendkim.yaml
  24. when: postfix_with_opendkim
  25. - import_tasks: opendmarc.yaml
  26. when: postfix_with_opendmarc
  27. - import_tasks: postfixadmin.yml
  28. when: postfix_method == "postfixadmin"
  29. - name: check postfix configuration
  30. command: postfix check
  31. changed_when: false
  32. - name: configuration pull directory
  33. local_action: file
  34. args:
  35. path: ~/host_files/{{inventory_hostname}}/etc
  36. state: directory
  37. - name: pull configuration
  38. synchronize:
  39. src: /etc/postfix
  40. dest: ~/host_files/{{inventory_hostname}}/etc/
  41. mode: pull
  42. recursive: true