---

- name: display checksums of known main.cf files
  debug:
    var: main_cf_known_checksums

- name: create minimal main.cf
  ansible.builtin.template:
    src: evolinux_main.cf.j2
    dest: /etc/postfix/main.cf
    owner: root
    group: root
    mode: "0644"
    force: true
  notify: restart postfix
  when: (postfix_force_main_cf | bool) or (main_cf_checksum.stdout in main_cf_known_checksums)
  tags:
  - postfix
