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