- name: install postfix apt: name: - postfix - bsd-mailx state: present - name: generate postifx configuration template: src: etc/postfix/main.cf.j2 dest: /etc/postfix/main.cf notify: restart postfix - name: enable postfix systemd: name: postfix enabled: yes state: started