-if node[:kernel] and node[:kernel][:modules]
- if node[:kernel][:modules].include?("mpt2sas")
- default[:apt][:sources] |= [ "hwraid" ]
+if Chef::Util.compare_versions(node[:kernel][:release], [3, 3]).negative?
+ default[:hardware][:modules] |= ["microcode"]
+
+ if node[:cpu][:"0"][:vendor_id] == "GenuineIntel"
+ default[:hardware][:modules] |= ["coretemp"]
+ end
+end
+
+if node[:kernel] && node[:kernel][:modules]
+ raidmods = node[:kernel][:modules].keys & %w[cciss hpsa mptsas mpt2sas mpt3sas megaraid_mm megaraid_sas aacraid]
+
+ default[:apt][:sources] |= ["hwraid"] unless raidmods.empty?
+end
+
+if node[:kernel][:modules].include?("ipmi_si")
+ default[:hardware][:modules] |= ["ipmi_devintf"]
+
+ if node[:kernel][:modules].include?("acpi_power_meter")
+ default[:hardware][:modules] |= ["acpi_ipmi"]