]> git.openstreetmap.org Git - chef.git/blob - cookbooks/hardware/attributes/default.rb
Bring ramoth's watchdog under chef control
[chef.git] / cookbooks / hardware / attributes / default.rb
1 default[:hardware][:sensors] = {}
2
3 if node[:dmi] and node[:dmi][:system]
4   case dmi.system.manufacturer
5   when "HP"
6     default[:apt][:sources] |= [ "management-component-pack" ]
7
8     case dmi.system.product_name
9       when "ProLiant DL360 G6", "ProLiant DL360 G7"
10         default[:hardware][:sensors]["power_meter-*"][:power]["power1"] = { :ignore => true }
11     end
12   end
13 end
14
15 if node[:kernel] and node[:kernel][:modules]
16   raidmods = node[:kernel][:modules].keys & ["cciss", "hpsa", "mptsas", "mpt2sas", "megaraid_mm", "megaraid_sas", "aacraid"]
17
18   unless raidmods.empty?
19     default[:apt][:sources] |= [ "hwraid" ]
20   end
21 end
22
23 if File.exists?("/proc/xen")
24   default[:hardware][:watchdog] = "xen_wdt"
25 elsif node[:kernel][:modules].include?("i6300esb")
26   default[:hardware][:watchdog] = "none"
27 end