--- # Run only under --check (the check step): fail2ban is not installed, so the tasks that need it skip. - name: Converge the base role on a host without fail2ban hosts: all roles: - role: mortis.kamino.fail2ban - name: Converge a service jail on a host without fail2ban hosts: all tasks: - name: Service jail with a journalmatch ansible.builtin.include_role: name: mortis.kamino.fail2ban tasks_from: service_jail vars: fail2ban_service_name: svc-a fail2ban_service_jail: port: "8080" journalmatch: "_SYSTEMD_UNIT=ssh.service" fail2ban_service_filter: failregex: "^.*denied for .*$"