X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/02b1060de163a2c653b5d2539b89e04702b0334c..9fcfa1aacf134b9db294d03cd9b6ba9a1527f154:/cookbooks/hardware/recipes/default.rb diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 5e4899476..d77aebacd 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -28,6 +28,10 @@ ohai_plugin "hardware" do 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" @@ -222,6 +226,10 @@ else 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" @@ -242,6 +250,8 @@ if node[:kernel][:modules].include?("ipmi_si") options "--config.file=/etc/prometheus/ipmi_local.yml" subscribes :restart, "template[/etc/prometheus/ipmi_local.yml]" end + + watchdog_module ||= "ipmi_watchdog" end package "irqbalance" @@ -605,19 +615,30 @@ node[:hardware][:blacklisted_modules].each do |module_name| 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