- name: dovecot setup gather_facts: no hosts: "{{target}}" become: "{{become}}" tasks: - name: config templates ansible.builtin.template: src: "{{ item }}" dest: /etc/dovecot/ mode: 0644 with_items: "{{ 'templates/*' | fileglob }}" notify: reload dovecot diff: true handlers: - name: reload dovecot ansible.builtin.shell: executable: /bin/sh cmd: "systemctl reload dovecot.service 2>/dev/null || dovecot reload"