From 75c5da85dcd5a6b5b66040dfd838c2bbf30ba4d5 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 12 Mar 2017 17:43:53 +0000 Subject: [PATCH] Remove no longer needed support for old Ubuntu versions --- cookbooks/apt/templates/default/hp.list.erb | 4 -- .../apt/templates/default/hwraid.list.erb | 5 -- cookbooks/chef/recipes/default.rb | 27 ++++------- cookbooks/db/recipes/base.rb | 8 +--- .../devices/templates/default/udev.rules.erb | 5 -- .../exim/templates/default/exim4.conf.erb | 6 --- cookbooks/fail2ban/recipes/default.rb | 21 -------- cookbooks/fail2ban/resources/jail.rb | 6 +-- .../fail2ban/templates/default/jail.local.erb | 5 -- cookbooks/hardware/recipes/default.rb | 48 ++++++------------- cookbooks/hardware/templates/default/grub.erb | 5 -- cookbooks/munin/.foodcritic | 1 + cookbooks/munin/recipes/default.rb | 7 --- cookbooks/openssh/recipes/default.rb | 5 -- cookbooks/tools/recipes/default.rb | 3 -- 15 files changed, 26 insertions(+), 130 deletions(-) delete mode 100644 cookbooks/fail2ban/templates/default/jail.local.erb diff --git a/cookbooks/apt/templates/default/hp.list.erb b/cookbooks/apt/templates/default/hp.list.erb index aa8fc7ee8..42f7a037f 100644 --- a/cookbooks/apt/templates/default/hp.list.erb +++ b/cookbooks/apt/templates/default/hp.list.erb @@ -1,7 +1,3 @@ # DO NOT EDIT - This file is being maintained by Chef -<% if node[:lsb][:release].to_f < 14.04 -%> -deb <%= @url %> precise/current non-free -<% else -%> deb <%= @url %> trusty/current non-free -<% end -%> diff --git a/cookbooks/apt/templates/default/hwraid.list.erb b/cookbooks/apt/templates/default/hwraid.list.erb index c933e5cd4..211e6b9b8 100644 --- a/cookbooks/apt/templates/default/hwraid.list.erb +++ b/cookbooks/apt/templates/default/hwraid.list.erb @@ -1,9 +1,4 @@ # DO NOT EDIT - This file is being maintained by Chef -<% if node[:lsb][:release].to_f > 12.04 -%> deb <%= @url %> precise main deb-src <%= @url %> precise main -<% else -%> -deb <%= @url %> <%= node[:lsb][:codename] %> main -deb-src <%= @url %> <%= node[:lsb][:codename] %> main -<% end -%> diff --git a/cookbooks/chef/recipes/default.rb b/cookbooks/chef/recipes/default.rb index c06384be7..9443d0548 100644 --- a/cookbooks/chef/recipes/default.rb +++ b/cookbooks/chef/recipes/default.rb @@ -114,16 +114,6 @@ if node[:lsb][:release].to_f >= 15.10 exec_start "/usr/bin/chef-client -i 1800 -s 20" restart "on-failure" end - - service "chef-client" do - provider Chef::Provider::Service::Systemd - action [:enable, :start] - supports :status => true, :restart => true, :reload => true - subscribes :restart, "dpkg_package[chef]" - subscribes :restart, "systemd_service[chef-client]" - subscribes :restart, "template[/etc/chef/client.rb]" - subscribes :restart, "template[/etc/chef/report.rb]" - end else template "/etc/init/chef-client.conf" do source "chef-client.conf.erb" @@ -131,14 +121,13 @@ else group "root" mode 0o644 end +end - service "chef-client" do - provider Chef::Provider::Service::Upstart - action [:enable, :start] - supports :status => true, :restart => true, :reload => true - subscribes :restart, "dpkg_package[chef]" - subscribes :restart, "template[/etc/init/chef-client.conf]" - subscribes :restart, "template[/etc/chef/client.rb]" - subscribes :restart, "template[/etc/chef/report.rb]" - end +service "chef-client" do + action [:enable, :start] + supports :status => true, :restart => true, :reload => true + subscribes :restart, "dpkg_package[chef]" + subscribes :restart, "template[/etc/init/chef-client.conf]" + subscribes :restart, "template[/etc/chef/client.rb]" + subscribes :restart, "template[/etc/chef/report.rb]" end diff --git a/cookbooks/db/recipes/base.rb b/cookbooks/db/recipes/base.rb index ae0b21604..f24e42e93 100644 --- a/cookbooks/db/recipes/base.rb +++ b/cookbooks/db/recipes/base.rb @@ -32,14 +32,8 @@ directory "/srv/www.openstreetmap.org" do mode 0o2775 end -ruby_version = if node[:lsb][:release].to_f >= 16.04 - "2.3" - else - "2.1" - end - rails_port "www.openstreetmap.org" do - ruby ruby_version + ruby "2.3" directory "/srv/www.openstreetmap.org/rails" user "rails" group "rails" diff --git a/cookbooks/devices/templates/default/udev.rules.erb b/cookbooks/devices/templates/default/udev.rules.erb index 837362bb0..d37fcb9eb 100644 --- a/cookbooks/devices/templates/default/udev.rules.erb +++ b/cookbooks/devices/templates/default/udev.rules.erb @@ -24,11 +24,6 @@ ACTION=="add", SUBSYSTEM=="block", ENV{ID_BUS}=="<%= device[:bus] %>", ENV{ID_SE <% end -%> <% end -%> <% end -%> -<% if node[:lsb][:release] == "12.04" && Chef::Util.compare_versions(node[:kernel][:release], [3, 11]) >= 0 -%> - -# Rule from 14.04 udev for 12.04 machines running newer kernels -ACTION=="add", SUBSYSTEM=="cpu", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -bv $env{MODALIAS}" -<% end -%> # Disable scatter-gather offload for HP NC362i network controllers SUBSYSTEM=="net", ACTION=="add", ATTRS{vendor}=="0x8086", ATTRS{device}=="0x10c9", ATTRS{subsystem_vendor}=="0x103c", ATTRS{subsystem_device}=="0x323f", RUN+="/sbin/ethtool -K $name gso off tso off sg off gro off" diff --git a/cookbooks/exim/templates/default/exim4.conf.erb b/cookbooks/exim/templates/default/exim4.conf.erb index f37dad240..e9cb2b9c1 100644 --- a/cookbooks/exim/templates/default/exim4.conf.erb +++ b/cookbooks/exim/templates/default/exim4.conf.erb @@ -330,9 +330,7 @@ acl_check_rcpt: # testing for an empty sending host field. accept hosts = : -<% if node[:lsb][:release].to_i >= 10.04 -%> control = dkim_disable_verify -<% end -%> ############################################################################# # The following section of the ACL is concerned with local parts that contain @@ -422,9 +420,7 @@ acl_check_rcpt: accept hosts = +relay_from_hosts control = submission -<% if node[:lsb][:release].to_i >= 10.04 -%> control = dkim_disable_verify -<% end -%> # Accept if the message arrived over an authenticated connection, from # any host. Again, these messages are usually from MUAs, so recipient @@ -433,9 +429,7 @@ acl_check_rcpt: accept authenticated = * control = submission -<% if node[:lsb][:release].to_i >= 10.04 -%> control = dkim_disable_verify -<% end -%> # Insist that any other recipient address that we accept is either in one of # our local domains, or is in a domain for which we explicitly allow diff --git a/cookbooks/fail2ban/recipes/default.rb b/cookbooks/fail2ban/recipes/default.rb index 50b31d1b3..b522bb374 100644 --- a/cookbooks/fail2ban/recipes/default.rb +++ b/cookbooks/fail2ban/recipes/default.rb @@ -19,27 +19,6 @@ package "fail2ban" -if node[:lsb][:release].to_f >= 14.04 - file "/etc/fail2ban/jail.local" do - action :delete - end -else - directory "/etc/fail2ban/jail.d" do - owner "root" - group "root" - mode 0o755 - end - - template "/etc/fail2ban/jail.local" do - source "jail.local.erb" - owner "root" - group "root" - mode 0o644 - subscribes :create, "template[/etc/fail2ban/jail.d/00-default.conf]" - notifies :reload, "service[fail2ban]" - end -end - template "/etc/fail2ban/jail.d/00-default.conf" do source "jail.default.erb" owner "root" diff --git a/cookbooks/fail2ban/resources/jail.rb b/cookbooks/fail2ban/resources/jail.rb index 01d9c502c..f51e06188 100644 --- a/cookbooks/fail2ban/resources/jail.rb +++ b/cookbooks/fail2ban/resources/jail.rb @@ -28,9 +28,5 @@ attribute :ports, :kind_of => Array, :default => [] attribute :maxretry, :kind_of => Integer def after_created - if node[:lsb][:release].to_f >= 14.04 - notifies :reload, "service[fail2ban]" - else - notifies :create, "template[/etc/fail2ban/jail.local]" - end + notifies :reload, "service[fail2ban]" end diff --git a/cookbooks/fail2ban/templates/default/jail.local.erb b/cookbooks/fail2ban/templates/default/jail.local.erb deleted file mode 100644 index 701e8e183..000000000 --- a/cookbooks/fail2ban/templates/default/jail.local.erb +++ /dev/null @@ -1,5 +0,0 @@ -# DO NOT EDIT - This file is being maintained by Chef -<% Dir.glob("/etc/fail2ban/jail.d/*.conf").sort do |file| -%> - -<%= File.read(file) %> -<% end -%> diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 9dd3c0a6a..d996bab48 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -27,11 +27,8 @@ end case node[:cpu][:"0"][:vendor_id] when "GenuineIntel" package "intel-microcode" -end - -case node[:cpu][:"0"][:vendor_id] when "AuthenticAMD" - package "amd64-microcode" if node[:lsb][:release].to_f >= 14.04 + package "amd64-microcode" end if node[:dmi] && node[:dmi][:system] @@ -184,21 +181,19 @@ end package "ipmitool" if node[:kernel][:modules].include?("ipmi_si") -if node[:lsb][:release].to_f >= 12.10 - package "irqbalance" +package "irqbalance" - template "/etc/default/irqbalance" do - source "irqbalance.erb" - owner "root" - group "root" - mode 0o644 - end +template "/etc/default/irqbalance" do + source "irqbalance.erb" + owner "root" + group "root" + mode 0o644 +end - service "irqbalance" do - action [:start, :enable] - supports :status => false, :restart => true, :reload => false - subscribes :restart, "template[/etc/default/irqbalance]" - end +service "irqbalance" do + action [:start, :enable] + supports :status => false, :restart => true, :reload => false + subscribes :restart, "template[/etc/default/irqbalance]" end # Link Layer Discovery Protocol Daemon @@ -487,22 +482,9 @@ template "/etc/modules" do mode 0o644 end -if node[:lsb][:release].to_f <= 12.10 - service "module-init-tools" do - provider Chef::Provider::Service::Upstart - action :nothing - subscribes :start, "template[/etc/modules]" - end -else - service "kmod" do - if node[:lsb][:release].to_f >= 15.10 - provider Chef::Provider::Service::Systemd - else - provider Chef::Provider::Service::Upstart - end - action :nothing - subscribes :start, "template[/etc/modules]" - end +service "kmod" do + action :nothing + subscribes :start, "template[/etc/modules]" end if node[:hardware][:watchdog] diff --git a/cookbooks/hardware/templates/default/grub.erb b/cookbooks/hardware/templates/default/grub.erb index b68b32651..305a5b0b0 100644 --- a/cookbooks/hardware/templates/default/grub.erb +++ b/cookbooks/hardware/templates/default/grub.erb @@ -31,13 +31,8 @@ GRUB_RECORDFAIL_TIMEOUT=2 # Send console output to the screen GRUB_TERMINAL="console" <% else -%> -<% if node[:lsb][:release].to_f >= 12.04 -%> # Send console output to the screen and serial port GRUB_TERMINAL="console serial" -<% else -%> -# Send console output to the serial port -GRUB_TERMINAL="serial" -<% end -%> # Configure the serial console GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=<%= @units.first %> --word=8 --parity=no --stop=1" diff --git a/cookbooks/munin/.foodcritic b/cookbooks/munin/.foodcritic index d8973b2fb..6f1cca483 100644 --- a/cookbooks/munin/.foodcritic +++ b/cookbooks/munin/.foodcritic @@ -1,4 +1,5 @@ ~FC001 ~FC003 +~FC005 ~FC064 ~FC065 diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index 39085f0e2..9a6b6e696 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -20,11 +20,6 @@ package "munin-node" service "munin-node" do - if node[:lsb][:release].to_f >= 15.10 - provider Chef::Provider::Service::Systemd - elsif node[:lsb][:release].to_f >= 14.04 - provider Chef::Provider::Service::Upstart - end action [:enable, :start] supports :status => true, :restart => true, :reload => true end @@ -212,7 +207,6 @@ if Dir.glob("/dev/ipmi*").empty? munin_plugin "ipmi_power" do action :delete - only_if { node[:lsb][:release].to_f >= 14.04 } end else munin_plugin_conf "ipmi" do @@ -229,7 +223,6 @@ else munin_plugin "ipmi_power" do target "ipmi_" - only_if { node[:lsb][:release].to_f >= 14.04 } end end diff --git a/cookbooks/openssh/recipes/default.rb b/cookbooks/openssh/recipes/default.rb index 2ab68392d..9eca4a5ba 100644 --- a/cookbooks/openssh/recipes/default.rb +++ b/cookbooks/openssh/recipes/default.rb @@ -24,11 +24,6 @@ package "openssh-client" package "openssh-server" service "ssh" do - if node[:lsb][:release].to_f >= 15.10 - provider Chef::Provider::Service::Systemd - elsif node[:lsb][:release].to_f >= 14.04 - provider Chef::Provider::Service::Upstart - end action [:enable, :start] supports :status => true, :restart => true, :reload => true end diff --git a/cookbooks/tools/recipes/default.rb b/cookbooks/tools/recipes/default.rb index b751792d2..5c872d909 100644 --- a/cookbooks/tools/recipes/default.rb +++ b/cookbooks/tools/recipes/default.rb @@ -34,9 +34,6 @@ package "xfsprogs" package "sysv-rc-conf" package "iotop" package "lvm2" - -package "lslk" if node[:lsb][:release].to_f <= 11.04 - package "rsyslog" service "rsyslog" do -- 2.39.5