]> 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 564e530187d3e25c9e3034c779916ef71d89864c..cdf37d881a1f18bfcb4290f5df4cf7018b40d87d 100644 (file)
@@ -65,7 +65,7 @@ when "HP"
     supports :status => true, :restart => true
   end
 
     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]"
     package "hp-ams" do
       action :install
       notifies :restart, "service[hp-ams]"
@@ -351,7 +351,7 @@ if !intel_ssds.empty? || !intel_nvmes.empty?
 end
 
 disks = disks.map do |disk|
 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]]
 
   if disk[:smart_device]
     controller = node[:hardware][:disk][:controllers][disk[:controller]]