No Description
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.3KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. - name: Install Postfix and related packages
  2. apt: pkg=$item state=installed
  3. with_items:
  4. - postfix
  5. - mysql-server
  6. - postfix-mysql
  7. - python-mysqldb
  8. - libsasl2-modules
  9. - sasl2-bin
  10. - postgrey
  11. - name: Create database user for mail server
  12. mysql_user: user={{ mail_mysql_username }} password={{ mail_mysql_password }} state=present priv="mailserver.*:ALL"
  13. - name: Create database for mail server
  14. mysql_db: name={{ mail_mysql_database }} state=present
  15. - name: copy over mailserver sql
  16. template: src=mailserver.sql.j2 dest=/etc/postfix/import.sql owner=root group=root mode=0600
  17. tags: import_mysql_postfix
  18. - name: import mysql postfix
  19. mysql_db: name={{ mail_mysql_database }} state=import target=/etc/postfix/import.sql
  20. tags: import_mysql_postfix
  21. - name: Copy Postfix config files into place
  22. template: src=etc_postfix_main.cf.j2 dest=/etc/postfix/main.cf owner=root group=root
  23. notify: restart postfix
  24. - name: Copy master.cf
  25. copy: src=etc_postfix_master.cf dest=/etc/postfix/master.cf owner=root group=root
  26. notify: restart postfix
  27. - name: Copy additional postfix configuration files
  28. template: src=etc_postfix_${item}.j2 dest=/etc/postfix/${item} owner=root group=root
  29. with_items:
  30. - mysql-virtual-mailbox-domains.cf
  31. - mysql-virtual-mailbox-maps.cf
  32. - mysql-virtual-alias-maps.cf
  33. notify: restart postfix