From c1e6343a081a3a989311deee09ecc66ba78a78f4 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 11 Mar 2024 17:41:32 +0000 Subject: [PATCH] Actively disable mod_evasive when necessary --- cookbooks/apache/recipes/default.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cookbooks/apache/recipes/default.rb b/cookbooks/apache/recipes/default.rb index 57d801903..b440dc388 100644 --- a/cookbooks/apache/recipes/default.rb +++ b/cookbooks/apache/recipes/default.rb @@ -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 -- 2.39.5