]> git.openstreetmap.org Git - chef.git/commitdiff
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 d7eddc6368a03abf20d11ba5f3fbdfbd6ba504e1..9b9a7a1745a2e229c0ed8322179ecfd645c47073 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 a8c90344927f818a25146df51470580db980c20b..3913764daaa7bdf0e0593763b54120c582bfc2c9 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 2b412eefca9fe0d270b6883425e2eec6bdb132ef..d9bcaba1b2c450d500842cdeeb53bc0482df2758 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 d0b1b74d52a07962cde806f4e6436952596aa158..0dbe07c2ff7f5cd476cc8739652e57d5941f1242 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 aa6d4e5e2e9099950a62901ff834294a7cce91bb..600f07ad1248c45f878cd9904288185aa7ff8637 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 caf0b3a554a525c5404f127b9213e7925a8c549f..63f0e21b0de1b3a69a60b3de1fc6fbf7a2841a55 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 89489f5bd49c6b2fe4acc45eb955c7bc26eb4357..5c923c8b7aa490b58fb9ad587084d2d7e7820200 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 4ce29d976ca88288f1f1ca6521cced0d9ed0ae83..ce5c55a22188c27df96c5f2d36a06e206ffe0b2d 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| -%>