- name: postfix - install package: state: latest name: - postfix - postfix-pcre - name: postfix - generate DH notify: reload postfix openssl_dhparam: path: /etc/postfix/dh.pem size: 4096 - name: postfix - create sql folder notify: reload postfix file: path: /etc/postfix/sql state: directory - name: postfix - config notify: reload postfix template: src: "postfix/{{ item }}" dest: "/etc/postfix/{{ item }}" with_items: - main.cf - master.cf - smtp_header_checks - sql/smtpd-sender-login-maps.cf - sql/tls-policy.cf - sql/virtual-sender-maps.cf - sql/virtual-alias-domains.cf - sql/virtual-alias-domains-maps.cf - sql/virtual-alias-maps.cf - sql/virtual-mailbox-domains.cf - sql/virtual-mailbox-maps.cf - name: postfix - start and enable on boot systemd: name: postfix enabled: yes state: started