Ei kuvausta
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.

dovecot.yml 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. - name: Install Dovecot and related packages
  2. apt: pkg={{ item }} state=installed
  3. with_items:
  4. - dovecot-core
  5. - dovecot-imapd
  6. - dovecot-lmtpd
  7. - dovecot-managesieved
  8. - dovecot-pgsql
  9. - dovecot-pop3d
  10. - postgresql-9.1
  11. when: ansible_distribution_release != 'trusty'
  12. - name: Install Dovecot and related packages for Ubuntu trusty
  13. apt: pkg={{ item }} state=installed
  14. with_items:
  15. - dovecot-core
  16. - dovecot-imapd
  17. - dovecot-lmtpd
  18. - dovecot-managesieved
  19. - dovecot-pgsql
  20. - dovecot-pop3d
  21. - postgresql-9.3
  22. when: ansible_distribution_release == 'trusty'
  23. - name: Create vmail group
  24. group: name=vmail state=present gid=5000
  25. - name: Create vmail user
  26. user: name=vmail group=vmail state=present uid=5000 home=/decrypted shell=/usr/sbin/nologin
  27. - name: Ensure mail domain directories are in place
  28. file: state=directory path=/decrypted/{{ item.name }} owner=vmail group=dovecot mode=770
  29. with_items: mail_virtual_domains
  30. - name: Ensure mail directories are in place
  31. file: state=directory path=/decrypted/{{ item.domain }}/{{ item.account }} owner=vmail group=dovecot
  32. with_items: mail_virtual_users
  33. - name: Copy dovecot.conf into place
  34. copy: src=etc_dovecot_dovecot.conf dest=/etc/dovecot/dovecot.conf
  35. - name: Copy additional Dovecot configuration files in place
  36. copy: src=etc_dovecot_conf.d_{{ item }} dest=/etc/dovecot/conf.d/{{ item }}
  37. with_items:
  38. - 10-auth.conf
  39. - 10-mail.conf
  40. - 10-master.conf
  41. - 10-ssl.conf
  42. - auth-sql.conf.ext
  43. notify: restart dovecot
  44. - name: Template 15-lda.conf
  45. template: src=etc_dovecot_conf.d_15-lda.conf.j2 dest=/etc/dovecot/conf.d/15-lda.conf
  46. notify: restart dovecot
  47. - name: Template dovecot-sql.conf.ext
  48. template: src=etc_dovecot_dovecot-sql.conf.ext.j2 dest=/etc/dovecot/dovecot-sql.conf.ext
  49. notify: restart dovecot
  50. - name: Ensure correct permissions on Dovecot config directory
  51. file: state=directory path=/etc/dovecot
  52. group=dovecot owner=vmail mode=770 recurse=yes
  53. notify: restart dovecot
  54. - name: Set firewall rules for dovecot
  55. ufw: rule=allow port={{ item }} proto=tcp
  56. with_items:
  57. - imaps
  58. - pop3s