From dfdc5bf2186da8ec7e26020598e3d41f12cb1073 Mon Sep 17 00:00:00 2001 From: Yannik Sembritzki Date: Wed, 4 Jan 2017 10:42:42 +0100 Subject: [PATCH] fix #40 --- templates/etc/fail2ban/jail.local.j2 | 30 ++++------------------------ 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/templates/etc/fail2ban/jail.local.j2 b/templates/etc/fail2ban/jail.local.j2 index 511f92c..590abc2 100644 --- a/templates/etc/fail2ban/jail.local.j2 +++ b/templates/etc/fail2ban/jail.local.j2 @@ -105,32 +105,10 @@ action = {{ fail2ban_action }} {% for service in fail2ban_services %} [{{ service.name }}] enabled = {{ service.enabled | default(true) | bool | to_json }} -{% if service.port is defined %} -port = {{ service.port }} -{% endif %} -{% if service.filter is defined %} -filter = {{ service.filter }} -{% endif %} -{% if service.logpath is defined %} -logpath = {{ service.logpath }} -{% endif %} -{% if service.maxretry is defined %} -maxretry = {{ service.maxretry }} -{% endif %} -{% if service.protocol is defined %} -protocol = {{ service.protocol }} -{% endif %} -{% if service.findtime is defined %} -findtime = {{ service.findtime }} -{% endif %} -{% if service.bantime is defined %} -bantime = {{ service.bantime }} -{% endif %} -{% if service.action is defined %} -action = {{ service.action }} -{% endif %} -{% if service.banaction is defined %} -banaction = {{ service.banaction }} +{% for option, value in service.iteritems() %} +{% if option not in ['name', 'enabled'] %} +{{ option }}={{ value }} {% endif %} +{% endfor %} {% endfor %}