- name: Install dovecot package: state: latest name: - dovecot - pigeonhole - name: dovecot create config folder file: path: "{{ item }}" state: directory mode: '0755' with_items: - /etc/dovecot - /etc/dovecot/conf.d - name: take default dovecot config copy: remote_src: yes src: "/usr/share/doc/dovecot/example-config/{{ item }}" dest: "/etc/dovecot/{{ item }}" with_items: - conf.d/auth-sql.conf.ext - name: dovecot config template: src: "dovecot/{{ item }}" dest: "/etc/dovecot/{{ item }}" with_items: - dovecot-sql.conf.ext - dovecot.conf - conf.d/10-auth.conf