Files
Kamino/roles/fail2ban/templates/jail.local.j2
T
DragonishandClaude Sonnet 5.5 57b15df1ac
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 26s
Molecule / molecule (pull_request) Successful in 52s
feat(fail2ban): add fail2ban_ignoreip to exempt trusted addresses
Write fail2ban_ignoreip as ignoreip in the [DEFAULT] section of jail.local, so
it applies to every jail, the service jails in jail.d included. The default is
Fail2Ban's own (127.0.0.1/8 and ::1). Entries are validated (no whitespace,
\Z-anchored) because they are joined into one line.

The first run after upgrading adds the [DEFAULT] section and restarts Fail2Ban
once.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q72rsMCgwaR1sbYZangwbp
2026-11-15 11:55:17 +00:00

25 lines
894 B
Django/Jinja

# Managed by Ansible - Fail2Ban jail.local
[DEFAULT]
ignoreip = {{ fail2ban_ignoreip | join(' ') }}
{% for jail in fail2ban_jails %}
[{{ jail.name }}]
enabled = {{ jail.enabled | default(true) }}
port = {{ jail.port | default('any') }}
filter = {{ jail.filter | default(jail.name) }}
{% if jail.backend is defined or jail.journalmatch is defined %}
backend = {{ jail.backend | default('systemd') }}
{% endif %}
{% if jail.journalmatch is defined %}
journalmatch = {{ jail.journalmatch }}
{% endif %}
{% if (jail.backend | default('systemd' if jail.journalmatch is defined else 'auto')) != 'systemd' %}
logpath = {{ jail.logpath | default('/var/log/auth.log') }}
{% endif %}
maxretry = {{ jail.maxretry | default(fail2ban_defaults.maxretry) }}
bantime = {{ jail.bantime | default(fail2ban_defaults.bantime) }}
findtime = {{ jail.findtime | default(fail2ban_defaults.findtime) }}
{% endfor %}