--- # tasks file for dovecot_postfix - name: set hostname shell: hostnamectl set-hostname "{{ hostdovecot }}" - name: Install dovecot apt_rpm: pkg: dovecot - name: copy postfix config copy: src: postfix/ dest: /etc/postfix/ force: yes - name: copy dovecot config copy: src: dovecot/ dest: /etc/dovecot/ force: yes - name: generate cert for postfix and dovecot shell: cd /etc/dovecot/cert/ && sh cert.sh cert - name: create user vmail shell: useradd -b /var -m -s /bin/false vmail - name: Set host samba ip shell: echo "{{ sambaip }}" "{{ hostsamba }}" >> /etc/hosts - name: Start postfix service: name: postfix state: restarted enabled: yes - name: Start dovecot service: name: dovecot state: started enabled: yes