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 3.0KB

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