1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
--- # tasks file for dovecot - name: include assert.yml include_tasks: assert.yml run_once: yes - name: install dovecot package: name: "{{ dovecot_packages }}" state: present notify: - copy sample configuration - name: flush handlers meta: flush_handlers - name: configure mail_location lineinfile: path: /etc/dovecot/conf.d/10-mail.conf regexp: "^mail_location" line: "mail_location = {{ dovecot_mailbox_location }}" mode: "0640" - name: configure mail_access_groups lineinfile: path: /etc/dovecot/conf.d/10-mail.conf regexp: "^mail_access_groups" line: "mail_access_groups = {{ dovecot_mail_access_groups }}" mode: "0640" - name: find users in /var/spool/mail find: path: /var/spool/mail register: dovecot_find_users - name: set permission in /var/spool/mail file: path: "{{ item.path }}" mode: "0600" loop: "{{ dovecot_find_users.files }}" loop_control: label: "{{ item.path | basename }}" - name: start and enable dovecot service: name: "{{ dovecot_service }}" state: started enabled: yes