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.4KB

1234567891011121314151617181920212223242526272829303132
  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. - copy: src=etc_postfix_master.cf dest=/etc/postfix/master.cf owner=root group=root
  24. - template: src=etc_postfix_mysql-virtual-mailbox-domains.cf.j2 dest=/etc/postfix/mysql-virtual-mailbox-domains.cf owner=root group=root
  25. - template: src=etc_postfix_mysql-virtual-mailbox-maps.cf.j2 dest=/etc/postfix/mysql-virtual-mailbox-maps.cf owner=root group=root
  26. - template: src=etc_postfix_mysql-virtual-alias-maps.cf.j2 dest=/etc/postfix/mysql-virtual-alias-maps.cf owner=root group=root
  27. notify: restart postfix