]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Don't monitor unconfigured or failed disks
[chef.git] / cookbooks / hardware / recipes / default.rb
index 936ffb01b4d3d360071f562c5b5a8e3ca3a9e4b8..cdf37d881a1f18bfcb4290f5df4cf7018b40d87d 100644 (file)
@@ -65,7 +65,7 @@ when "HP"
     supports :status => true, :restart => true
   end
 
-  if product.end_with?("Gen8")
+  if product.end_with?("Gen8", "Gen9")
     package "hp-ams" do
       action :install
       notifies :restart, "service[hp-ams]"
@@ -93,21 +93,6 @@ when "IBM"
   units << "0"
 end
 
-# Remove legacy HP G4 support which breaks modern hp-health 10.4
-if manufacturer == "HP"
-  %w[/opt/hp/hp-health/bin/hpasmd /usr/lib/libhpasmintrfc.so.3.0 /usr/lib/libhpasmintrfc.so.3 /usr/lib/libhpasmintrfc.so].each do |filename|
-    file filename do
-      action :delete
-      manage_symlink_source false
-    end
-  end
-
-  directory "/opt/hp/hp-legacy" do
-    action :delete
-    recursive true
-  end
-end
-
 units.sort.uniq.each do |unit|
   if node[:lsb][:release].to_f >= 16.04
     service "serial-getty@ttyS#{unit}" do
@@ -366,7 +351,7 @@ if !intel_ssds.empty? || !intel_nvmes.empty?
 end
 
 disks = disks.map do |disk|
-  next if disk[:state] == "spun_down"
+  next if disk[:state] == "spun_down" || %w[unconfigured failed].any?(disk[:status])
 
   if disk[:smart_device]
     controller = node[:hardware][:disk][:controllers][disk[:controller]]