]> git.openstreetmap.org Git - chef.git/commitdiff
Disable old mpms before enabling a new one
authorTom Hughes <tom@compton.nu>
Thu, 21 Jun 2018 16:40:08 +0000 (17:40 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 21 Jun 2018 16:40:41 +0000 (17:40 +0100)
cookbooks/apache/recipes/default.rb

index bbd15a9d3425bb6ce506831b4c9c9002dc5a982b..989755f67a4e04f333cc542c6b91ee1a08b24dd8 100644 (file)
@@ -25,17 +25,17 @@ package %w[
 ]
 
 %w[event itk prefork worker].each do |mpm|
 ]
 
 %w[event itk prefork worker].each do |mpm|
-  if mpm == node[:apache][:mpm]
-    apache_module "mpm_#{mpm}" do
-      action [:enable]
-    end
-  else
-    apache_module "mpm_#{mpm}" do
-      action [:disable]
-    end
+  next if mpm == node[:apache][:mpm]
+
+  apache_module "mpm_#{mpm}" do
+    action [:disable]
   end
 end
 
   end
 end
 
+apache_module "mpm_#{node[:apache][:mpm]}" do
+  action [:enable]
+end
+
 admins = data_bag_item("apache", "admins")
 
 apache_conf "httpd" do
 admins = data_bag_item("apache", "admins")
 
 apache_conf "httpd" do