Get rid of pre 14.04 compatibility that is no longer needed
authorTom Hughes <tom@compton.nu>
Fri, 6 May 2016 21:24:33 +0000 (22:24 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 6 May 2016 21:24:33 +0000 (22:24 +0100)
cookbooks/apache/providers/conf.rb
cookbooks/apache/providers/site.rb
cookbooks/apache/recipes/default.rb
cookbooks/apache/recipes/ssl.rb
cookbooks/apache/templates/default/ports.conf.erb
cookbooks/apache/templates/default/ssl.erb
cookbooks/tile/recipes/default.rb
cookbooks/tile/templates/default/renderd.conf.erb

index d7eddc6..9b9a7a1 100644 (file)
@@ -23,32 +23,20 @@ end
 
 use_inline_resources
 
-action :create do # ~FC017
-  if node[:lsb][:release].to_f >= 14.04
-    create_conf
-  end
+action :create do
+  create_conf
 end
 
-action :enable do # ~FC017
-  if node[:lsb][:release].to_f >= 14.04
-    enable_conf
-  else
-    create_conf
-  end
+action :enable do
+  enable_conf
 end
 
-action :disable do # ~FC017
-  if node[:lsb][:release].to_f >= 14.04
-    disable_conf
-  else
-    delete_conf
-  end
+action :disable do
+  disable_conf
 end
 
-action :delete do # ~FC017
-  if node[:lsb][:release].to_f >= 14.04
-    delete_conf
-  end
+action :delete do
+  delete_conf
 end
 
 def create_conf
@@ -83,17 +71,9 @@ def delete_conf
 end
 
 def available_name
-  if node[:lsb][:release].to_f >= 14.04
-    "/etc/apache2/conf-available/#{new_resource.name}.conf"
-  else
-    "/etc/apache2/conf.d/#{new_resource.name}"
-  end
+  "/etc/apache2/conf-available/#{new_resource.name}.conf"
 end
 
 def enabled_name
-  if node[:lsb][:release].to_f >= 14.04
-    "/etc/apache2/conf-enabled/#{new_resource.name}.conf"
-  else
-    "/etc/apache2/conf.d/#{new_resource.name}"
-  end
+  "/etc/apache2/conf-enabled/#{new_resource.name}.conf"
 end
index a8c9034..3913764 100644 (file)
@@ -59,27 +59,14 @@ def site_directory
 end
 
 def available_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
+  "/etc/apache2/sites-available/#{new_resource.name}.conf"
 end
 
 def enabled_name
-  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
+  case new_resource.name
+  when "default"
+    "/etc/apache2/sites-enabled/000-default.conf"
   else
-    case new_resource.name
-    when "default"
-      "/etc/apache2/sites-enabled/000-default"
-    else
-      "/etc/apache2/sites-enabled/#{new_resource.name}"
-    end
+    "/etc/apache2/sites-enabled/#{new_resource.name}.conf"
   end
 end
index 2b412ee..d9bcaba 100644 (file)
 package "apache2"
 package "libwww-perl"
 
-if node[:lsb][:release].to_f < 14.04
-  package "apache2-mpm-#{node[:apache][:mpm]}" do
-    notifies :restart, "service[apache2]"
-  end
-else
-  %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
+%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
   end
 end
 
 admins = data_bag_item("apache", "admins")
 
-if node[:lsb][:release].to_f < 14.04
-  template "/etc/apache2/httpd.conf" do
-    source "httpd.conf.erb"
-    owner "root"
-    group "root"
-    mode 0644
-    notifies :reload, "service[apache2]"
-  end
-else
-  apache_conf "httpd" do
-    template "httpd.conf.erb"
-    notifies :reload, "service[apache2]"
-  end
+apache_conf "httpd" do
+  template "httpd.conf.erb"
+  notifies :reload, "service[apache2]"
 end
 
 template "/etc/apache2/ports.conf" do
index d0b1b74..0dbe07c 100644 (file)
@@ -25,10 +25,6 @@ node.default[:ssl][:certificates] = node[:ssl][:certificates] | [certificate]
 include_recipe "apache"
 include_recipe "ssl"
 
-apache_module "socache_shmcb" do
-  only_if { node[:lsb][:release].to_f >= 14.04 }
-end
-
 apache_module "ssl"
 
 apache_conf "ssl" do
index aa6d4e5..600f07a 100644 (file)
@@ -1,23 +1,14 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
 # Listen on port 80
-<% if node[:lsb][:release].to_f < 14.04 -%>
-NameVirtualHost *:80
-<% end -%>
 Listen <%= node[:apache][:listen_address] %>:80
 
 # Listen on port 443 if mod_ssl is enabled
 <IfModule mod_ssl.c>
-    <% if node[:lsb][:release].to_f < 14.04 -%>
-    NameVirtualHost *:443
-    <% end -%>
     Listen <%= node[:apache][:listen_address] %>:443
 </IfModule>
 
 # Listen on port 443 if mod_gnutls is enabled
 <IfModule mod_gnutls.c>
-    <% if node[:lsb][:release].to_f < 14.04 -%>
-    NameVirtualHost *:443
-    <% end -%>
     Listen <%= node[:apache][:listen_address] %>:443
 </IfModule>
index caf0b3a..63f0e21 100644 (file)
@@ -8,10 +8,8 @@ SSLCipherSuite <%= node[:ssl][:ciphers] -%>
 SSLCertificateFile /etc/ssl/certs/<%= @certificate %>.pem
 SSLCertificateKeyFile /etc/ssl/private/<%= @certificate %>.key
 SSLCertificateChainFile /etc/ssl/certs/<%= @certificate_chain %>.pem
-<% if node[:lsb][:release].to_f >= 14.04 -%>
 
 SSLUseStapling On
 SSLStaplingResponderTimeout 5
 SSLStaplingReturnResponderErrors off
 SSLStaplingCache shmcb:${APACHE_RUN_DIR}/ssl_ocspcache(512000)
-<% end -%>
index 89489f5..5c923c8 100644 (file)
@@ -381,10 +381,6 @@ package "osmosis"
 package "ruby"
 package "ruby-dev"
 
-if node[:lsb][:release].to_f < 14.04
-  package "rubygems"
-end
-
 package "libproj-dev"
 package "libxml2-dev"
 
index 4ce29d9..ce5c55a 100644 (file)
@@ -7,11 +7,7 @@ tile_dir=/srv/tile.openstreetmap.org/tiles
 stats_file=/var/run/renderd/renderd.stats
 
 [mapnik]
-<% if node[:lsb][:release].to_f >= 14.04 -%>
 plugins_dir=/usr/lib/mapnik/2.2/input
-<% else -%>        
-plugins_dir=/usr/lib/mapnik/input
-<% end -%>        
 font_dir=/usr/share/fonts
 font_dir_recurse=true
 <% node[:tile][:styles].each do |name,details| -%>