template "ohai.rb.erb"
end
+if platform?("debian")
+ package "firmware-linux"
+end
+
if node[:cpu] && node[:cpu][:"0"] && node[:cpu][:"0"][:vendor_id]
case node[:cpu][:"0"][:vendor_id]
when "GenuineIntel"
end
end
+watchdog_module = %w[hpwdt sp5100_tco].find do |module_name|
+ node[:hardware][:pci].any? { |_, pci| pci[:modules]&.any?(module_name) }
+end
+
if node[:kernel][:modules].include?("ipmi_si")
package "ipmitool"
package "freeipmi-tools"
options "--config.file=/etc/prometheus/ipmi_local.yml"
subscribes :restart, "template[/etc/prometheus/ipmi_local.yml]"
end
+
+ watchdog_module ||= "ipmi_watchdog"
end
package "irqbalance"
end
end
-if node[:hardware][:watchdog]
- package "watchdog"
+if watchdog_module
+ kernel_module watchdog_module do
+ action :install
+ end
+
+ execute "systemctl-reload" do
+ action :nothing
+ command "systemctl daemon-reload"
+ user "root"
+ group "root"
+ end
- template "/etc/default/watchdog" do
- source "watchdog.erb"
+ directory "/etc/systemd/system.conf.d" do
owner "root"
group "root"
- mode "644"
- variables :module => node[:hardware][:watchdog]
+ mode "755"
end
- service "watchdog" do
- action [:enable, :start]
+ template "/etc/systemd/system.conf.d/watchdog.conf" do
+ source "watchdog.conf.erb"
+ owner "root"
+ group "root"
+ mode "644"
+ notifies :run, "execute[systemctl-reload]"
end
end