]> git.openstreetmap.org Git - chef.git/commitdiff
Apache site files need to end with .conf on 14.04
authorTom Hughes <tom@compton.nu>
Tue, 10 Jun 2014 11:52:52 +0000 (12:52 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 10 Jun 2014 11:52:52 +0000 (12:52 +0100)
cookbooks/apache/providers/site.rb

index 1b13a3d0221e406fcf845cae72b00c1148f73b88..86fecbfcf73376718984ac6c34a7d4395fe3c749 100644 (file)
@@ -68,15 +68,28 @@ def site_directory
 end
 
 def available_name
-  "/etc/apache2/sites-available/#{new_resource.name}"
+  if node[:lsb][:release].to_f >= 14.04
+    "/etc/apache2/sites-available/#{new_resource.name}.conf"
+  else
+    "/etc/apache2/sites-available/#{new_resource.name}"
+  end
 end
 
 def enabled_name
-  case new_resource.name
-  when "default"
-    "/etc/apache2/sites-enabled/000-default"
+  if node[:lsb][:release].to_f >= 14.04
+    case new_resource.name
+    when "default"
+      "/etc/apache2/sites-enabled/000-default.conf"
+    else
+      "/etc/apache2/sites-enabled/#{new_resource.name}.conf"
+    end
   else
-    "/etc/apache2/sites-enabled/#{new_resource.name}"
+    case new_resource.name
+    when "default"
+      "/etc/apache2/sites-enabled/000-default"
+    else
+      "/etc/apache2/sites-enabled/#{new_resource.name}"
+    end
   end
 end