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.

dovecot.yml 2.7KB

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