:logpath => new_resource.logpath,
:protocol => new_resource.protocol,
:ports => new_resource.ports,
- :maxretry => new_resource.maxretry
+ :maxretry => new_resource.maxretry,
+ :ignoreips => new_resource.ignoreips
end
end
attribute :protocol, :kind_of => String
attribute :ports, :kind_of => Array, :default => []
attribute :maxretry, :kind_of => Integer
+attribute :ignoreips, :kind_of => Array
def after_created
notifies :reload, "service[fail2ban]"
<% if @maxretry -%>
maxretry = <%= @maxretry %>
<% end -%>
+<% if @ignoreips -%>
+ignoreip = <%= @ignoreips.join(",") %>
+<% end -%>
include_recipe "fail2ban"
+web_servers = search(:node, "recipes:web\\:\\:frontend").collect do |n| # ~FC010
+ n.ipaddresses(:role => :external)
+end.flatten
+
fail2ban_filter "nominatim" do
failregex '^<HOST> - - \[\] "[^"]+" (400|429) '
end
logpath "/var/log/apache2/nominatim.openstreetmap.org-access.log"
ports [80, 443]
maxretry 100
+ ignoreips web_servers
end
munin_plugin_conf "nominatim" do