Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

postfix.yml 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. - name: Install Postgres
  2. apt: pkg=postgresql state=present
  3. tags:
  4. - dependencies
  5. - name: Install Postfix and related packages
  6. apt: pkg={{ item }} state=installed
  7. with_items:
  8. - libsasl2-modules
  9. - postfix
  10. - postfix-pcre
  11. - postfix-pgsql
  12. - postgrey
  13. - python-psycopg2
  14. - sasl2-bin
  15. tags:
  16. - dependencies
  17. - name: Set postgres password
  18. command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with password '{{ db_admin_password }}';"
  19. notify: import sql postfix
  20. - name: Create database user for mail server
  21. postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ mail_db_username }} password="{{ mail_db_password }}" state=present
  22. notify: import sql postfix
  23. - name: Create database for mail server
  24. postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ mail_db_database }} state=present owner={{ mail_db_username }}
  25. notify: import sql postfix
  26. - name: Copy import.sql
  27. template: src=mailserver.sql.j2 dest=/etc/postfix/import.sql owner=root group=root mode=0600
  28. notify: import sql postfix
  29. - name: Create postfix maps directory
  30. file: path=/etc/postfix/maps state=directory owner=root group=root
  31. when: mail_header_privacy == 1
  32. - name: Copy smtp_header_checks.pcre
  33. copy: src=etc_postfix_maps_smtp_header_checks.pcre dest=/etc/postfix/maps/smtp_header_checks.pcre owner=root group=root
  34. when: mail_header_privacy == 1
  35. - name: Copy main.cf
  36. template: src=etc_postfix_main.cf.j2 dest=/etc/postfix/main.cf owner=root group=root
  37. notify: restart postfix
  38. - name: Copy master.cf
  39. copy: src=etc_postfix_master.cf dest=/etc/postfix/master.cf owner=root group=root
  40. notify: restart postfix
  41. - name: Copy additional postfix configuration files
  42. template: src=etc_postfix_{{ item }}.j2 dest=/etc/postfix/{{ item }} owner=root group=root
  43. with_items:
  44. - pgsql-virtual-alias-maps.cf
  45. - pgsql-virtual-mailbox-domains.cf
  46. - pgsql-virtual-mailbox-maps.cf
  47. notify: restart postfix
  48. - name: Set firewall rules for postfix
  49. ufw: rule=allow port={{ item }} proto=tcp
  50. with_items:
  51. - smtp
  52. - ssmtp
  53. tags: ufw