]> git.openstreetmap.org Git - chef.git/blob - cookbooks/hardware/attributes/default.rb
Allow pinning kernel versions to work around hardware / driver issues
[chef.git] / cookbooks / hardware / attributes / default.rb
1 default[:hardware][:modules] = %w(loop lp rtc)
2 default[:hardware][:grub][:cmdline] = %w(nomodeset)
3 default[:hardware][:grub][:kernel] = :latest
4 default[:hardware][:sensors] = {}
5
6 if node[:dmi] && node[:dmi][:system]
7   case dmi.system.manufacturer
8   when "HP"
9     default[:apt][:sources] |= ["management-component-pack"]
10
11     case dmi.system.product_name
12     when "ProLiant DL360 G6", "ProLiant DL360 G7"
13       default[:hardware][:sensors][:"power_meter-*"][:power][:power1] = { :ignore => true }
14     end
15   end
16 end
17
18 if Chef::Util.compare_versions(node[:kernel][:release], [3, 3]) < 0
19   default[:hardware][:modules] |= ["microcode"]
20
21   if node[:cpu][:"0"][:vendor_id] == "GenuineIntel"
22     default[:hardware][:modules] |= ["coretemp"]
23   end
24 end
25
26 if node[:kernel] && node[:kernel][:modules]
27   raidmods = node[:kernel][:modules].keys & %w(cciss hpsa mptsas mpt2sas mpt3sas megaraid_mm megaraid_sas aacraid)
28
29   unless raidmods.empty?
30     default[:apt][:sources] |= ["hwraid"]
31   end
32 end
33
34 if node[:kernel][:modules].include?("ipmi_si")
35   default[:hardware][:modules] |= ["ipmi_devintf"]
36 end
37
38 if File.exist?("/proc/xen")
39   default[:hardware][:watchdog] = "xen_wdt"
40 elsif node[:kernel][:modules].include?("i6300esb")
41   default[:hardware][:watchdog] = "none"
42 end