]> git.openstreetmap.org Git - chef.git/commitdiff
Actively disable mod_evasive when necessary
authorTom Hughes <tom@compton.nu>
Mon, 11 Mar 2024 17:41:32 +0000 (17:41 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 11 Mar 2024 17:41:32 +0000 (17:41 +0000)
cookbooks/apache/recipes/default.rb

index 57d8019034ccd113083c6cbeee2534d702919c21..b440dc38886e501552ec29a876761624b9e39f3d 100644 (file)
@@ -79,9 +79,14 @@ apache_module "status" do
   variables :hosts => admins["hosts"]
 end
 
-apache_module "evasive" do
-  conf "evasive.conf.erb"
-  only_if { node[:apache][:evasive] }
+if node[:apache][:evasive]
+  apache_module "evasive" do
+    conf "evasive.conf.erb"
+  end
+else
+  apache_module "evasive" do
+    action :disable
+  end
 end
 
 apache_module "brotli" do