- name: install postfix apt: pkg: postfix - name: remove exim4 package apt: name: exim4 state: absent - name: copy main.cf template: src: main.cf.j2 dest: /etc/postfix/main.cf notify: - restart postfix - name: copy master.cf template: src: master.cf.j2 dest: /etc/postfix/master.cf notify: - restart postfix - name: copy postfix maps template: src: maps.j2 dest: "{{ item }}" with_items: "{{ postfixmaps|d([]) }}" notify: - restart postfix