]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/fail2ban/templates/default/jail.erb
Make more fail2ban jail properties optional
[chef.git] / cookbooks / fail2ban / templates / default / jail.erb
index 20010d1b217854e12304a2983fa729811f45edb1..91978488c5569caaed9f077b6ced382f2ab343ea 100644 (file)
@@ -1,20 +1,22 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
 # DO NOT EDIT - This file is being maintained by Chef
 
-[DEFAULT]
-destemail = admins@openstreetmap.org
-banaction = shorewall
-bantime = 14400
-<% @jails.each do |jail| -%>
-
-[<%= jail[:name] %>]
+[<%= @name %>]
 enabled = true
 enabled = true
-<% if jail[:protocol] -%>
-protocol = <%= jail[:protocol] %>
+<% if @protocol -%>
+protocol = <%= @protocol %>
+<% end -%>
+<% if @ports -%>
+port = <%= @ports.join(",") %>
+<% end -%>
+<% if @filter -%>
+filter = <%= @filter %>
+<% end -%>
+<% if @logpath -%>
+logpath = <%= @logpath %>
 <% end -%>
 <% end -%>
-port = <%= jail[:port] %>
-filter = <%= jail[:filter] %>
-logpath = <%= jail[:logpath] %>
-<% if jail[:maxretry] -%>
-maxretry = <%= jail[:maxretry] %>
+<% if @maxretry -%>
+maxretry = <%= @maxretry %>
 <% end -%>
 <% end -%>
+<% if @ignoreips -%>
+ignoreip = <%= @ignoreips.sort.join(" ") %>
 <% end -%>
 <% end -%>