--- - name: Configure Fail2Ban jail.local become: true ansible.builtin.template: src: jail.local.j2 dest: /etc/fail2ban/jail.local owner: root group: root mode: "0600" notify: Reload Fail2Ban # Under --check on a fresh host the package is not installed, so /etc/fail2ban is missing. when: not ansible_check_mode or __fail2ban_install | default({}) is not changed