Açıklama Yok
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.

postfix.yml 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. - name: Install Postfix and related packages
  2. apt: pkg={{ item }} state=installed
  3. with_items:
  4. - postfix
  5. - libsasl2-modules
  6. - sasl2-bin
  7. - postgrey
  8. - postgresql-9.1
  9. - postfix-pgsql
  10. - python-psycopg2
  11. - postfix-pcre
  12. - name: Set postgres password
  13. command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with password '{{ db_admin_password }}';"
  14. notify: import sql postfix
  15. - name: Create database user for mail server
  16. 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
  17. notify: import sql postfix
  18. - name: Create database for mail server
  19. 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 }}
  20. notify: import sql postfix
  21. - name: Copy import.sql
  22. template: src=mailserver.sql.j2 dest=/etc/postfix/import.sql owner=root group=root mode=0600
  23. notify: import sql postfix
  24. - name: Create postfix maps directory
  25. file: path=/etc/postfix/maps state=directory owner=root group=root
  26. when: mail_header_privacy == 1
  27. - name: Copy smtp_header_checks.pcre
  28. copy: src=etc_postfix_maps_smtp_header_checks.pcre dest=/etc/postfix/maps/smtp_header_checks.pcre owner=root group=root
  29. when: mail_header_privacy == 1
  30. - name: Copy main.cf
  31. template: src=etc_postfix_main.cf.j2 dest=/etc/postfix/main.cf owner=root group=root
  32. notify: restart postfix
  33. - name: Copy master.cf
  34. copy: src=etc_postfix_master.cf dest=/etc/postfix/master.cf owner=root group=root
  35. notify: restart postfix
  36. - name: Copy additional postfix configuration files
  37. template: src=etc_postfix_{{ item }}.j2 dest=/etc/postfix/{{ item }} owner=root group=root
  38. with_items:
  39. - pgsql-virtual-mailbox-domains.cf
  40. - pgsql-virtual-mailbox-maps.cf
  41. - pgsql-virtual-alias-maps.cf
  42. notify: restart postfix