From ff86460243bf6c6d0cc69689a5aafd65fb2c600c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 5 Mar 2024 10:35:44 +0000 Subject: [PATCH] Enable hardware watchdog support on more machines --- cookbooks/hardware/recipes/default.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 93891599a..d77aebacd 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -120,8 +120,6 @@ when "HP", "HPE" else "1" end - - watchdog_module = "hpwdt" when "TYAN" units << "0" when "TYAN Computer Corporation" @@ -228,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" @@ -248,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" -- 2.39.5