Nessuna descrizione
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 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. - name: Set postgres password
  12. command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with password '{{ db_admin_password }}';"
  13. notify: import sql postfix
  14. - name: Create database user for mail server
  15. 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
  16. notify: import sql postfix
  17. - name: Create database for mail server
  18. 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 }}
  19. notify: import sql postfix
  20. - name: Copy import.sql
  21. template: src=mailserver.sql.j2 dest=/etc/postfix/import.sql owner=root group=root mode=0600
  22. notify: import sql postfix
  23. - name: Copy main.cf
  24. template: src=etc_postfix_main.cf.j2 dest=/etc/postfix/main.cf owner=root group=root
  25. notify: restart postfix
  26. - name: Copy master.cf
  27. copy: src=etc_postfix_master.cf dest=/etc/postfix/master.cf owner=root group=root
  28. notify: restart postfix
  29. - name: Copy additional postfix configuration files
  30. template: src=etc_postfix_{{ item }}.j2 dest=/etc/postfix/{{ item }} owner=root group=root
  31. with_items:
  32. - pgsql-virtual-mailbox-domains.cf
  33. - pgsql-virtual-mailbox-maps.cf
  34. - pgsql-virtual-alias-maps.cf
  35. notify: restart postfix