--- - name: "Postfix | Copy main.cf" ansible.builtin.template: src: postfix/main.cf.j2 dest: /etc/postfix/main.cf mode: "0644" notify: reload postfix - name: "Postfix | Copy master.cf" ansible.builtin.template: src: postfix/master.cf dest: /etc/postfix/master.cf mode: "0644" notify: restart postfix - name: "Postfix | Create configuration directory" ansible.builtin.file: path: "{{ postfix_conf_dir }}" state: directory mode: "0755" - name: "Postfix | Copy lookup tables" ansible.builtin.copy: src: "postfix/conf.d/{{ item }}" dest: "{{ postfix_conf_dir }}/{{ item }}" mode: "0644" loop: - bogus_mx - header_checks - header_checks_inbound - name: "Postfix | Copy lookup tables from templates" ansible.builtin.template: src: "postfix/conf.d/{{ item }}.j2" dest: "{{ postfix_conf_dir }}/{{ item }}" mode: "0644" loop: - bad_smtp_auth_users - client_checks - destination_limit - header_add - header_treatment - permit_sasl_login_mismatch - postscreen_access - relay_by_sender - relay_checks - sender_checks - transport_global_exceptions - transport_relay notify: reload postfix - name: "Postfix | Run postmap" ansible.builtin.command: "postmap {{ item.table | default('cdb') }}:{{ item.file }}" args: chdir: "{{ postfix_conf_dir }}" changed_when: false notify: reload postfix loop: - file: bad_smtp_auth_users - file: client_checks - file: destination_limit - file: permit_sasl_login_mismatch - file: relay_checks - file: sender_checks - file: transport_relay - name: "Postfix | Create dhparam file" community.crypto.openssl_dhparam: path: "{{ postfix_dhparam_file }}" size: 4096 - name: "Postfix | Setup cron job for pflogsum" ansible.builtin.cron: name: "Ansible: Daily pflogsum statistics" job: /usr/sbin/pflogsumm --detail 8 --problems-first --no-no-msg-size --reject-detail 12 /var/log/mail.log.1 | mail -s "{{ postfix_pflogsum_mail_subject }} ({{ inventory_hostname }})" {{ postfix_pflogsum_recipient }} hour: "06" minute: "24"