]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Fix indentation
[chef.git] / cookbooks / hardware / recipes / default.rb
index a81e0966c3df05dc6385f30dfdf0ee6df2555e89..59a078894b9cebbee5c053c27ec5927546a9beb9 100644 (file)
@@ -22,6 +22,13 @@ when "GenuineIntel"
   package "intel-microcode"
 end
 
+case node[:cpu][:"0"][:vendor_id]
+when "AuthenticAMD"
+  if node[:lsb][:release].to_f >= 14.04
+    package "amd64-microcode"
+  end
+end
+
 if node[:dmi] and node[:dmi][:system]
   case node[:dmi][:system][:manufacturer]
   when "empty"
@@ -50,7 +57,7 @@ when "TYAN Computer Corporation"
   speed = "115200"
 when "Supermicro"
   case product
-  when "H8DGU", "X9SCD", "X7DBU", "X7DW3", "X9DR7/E-(J)LN4F", "X9DR3-F"
+  when "H8DGU", "X9SCD", "X7DBU", "X7DW3", "X9DR7/E-(J)LN4F", "X9DR3-F", "X9DRW"
     unit = "1"
     speed = "115200"
   else
@@ -106,7 +113,7 @@ unless unit.nil?
     provider Chef::Provider::Service::Upstart
     action [ :enable, :start ]
     supports :status => true, :restart => true, :reload => false
-    subscribes :restart, resources(:template => "/etc/init/ttyS#{unit}.conf")
+    subscribes :restart, "template[/etc/init/ttyS#{unit}.conf]"
   end
 end
 
@@ -122,7 +129,7 @@ if File.exist?("/etc/default/grub")
     group "root"
     mode 0644
     variables :unit => unit, :speed => speed
-    notifies :run, resources(:execute => "update-grub")
+    notifies :run, "execute[update-grub]"
   end
 end
 
@@ -141,6 +148,27 @@ template "/etc/initramfs-tools/conf.d/mdadm" do
   notifies :run, "execute[update-initramfs]"
 end
 
+if node[:kernel][:modules].include?("ipmi_si")
+  package "ipmitool"
+end
+
+if node[:lsb][:release].to_f >= 12.10
+  package "irqbalance"
+
+  template "/etc/default/irqbalance" do
+    source "irqbalance.erb"
+    owner "root"
+    group "root"
+    mode 0644
+  end
+
+  service "irqbalance" do
+    action [ :start, :enable ]
+    supports :status => false, :restart => true, :reload => false
+    subscribes :restart, "template[/etc/default/irqbalance]"
+  end
+end
+
 tools_packages = []
 status_packages = {}
 
@@ -172,8 +200,8 @@ end
 
 node[:block_device].each do |name,attributes|
   if attributes[:vendor] == "HP" and attributes[:model] == "LOGICAL VOLUME"
-    if name =~ /^cciss!(.*)$/
-      status_packages["cciss-vol-status"] |= [ "cciss/#{$1}" ]
+    if name =~ /^cciss!(c[0-9]+)d[0-9]+$/
+      status_packages["cciss-vol-status"] |= [ "cciss/#{$1}d0" ]
     else
       Dir.glob("/sys/block/#{name}/device/scsi_generic/*").each do |sg|
         status_packages["cciss-vol-status"] |= [ File.basename(sg) ]