]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
hp-health service does not support reload
[chef.git] / cookbooks / hardware / recipes / default.rb
index 657395cf1b831dd29b73d0b57e43846556947a69..d999d28e5a8856a5c588da00872c06d687427b9c 100644 (file)
@@ -59,7 +59,20 @@ end
 case manufacturer
 when "HP"
   package "hponcfg"
-  package "hp-health"
+
+  # Downgrade hp-health to 10.0.0.1.3-4. as 10.40-1815.49 has issues with reliable startup
+  package "hp-health" do
+    action :install
+    version "10.0.0.1.3-4."
+    options "--allow-downgrades"
+    notifies :restart, "service[hp-health]"
+  end
+
+  service "hp-health" do
+    action [:enable, :start]
+    supports :status => true, :restart => true
+  end
+
   units << "1"
 when "TYAN"
   units << "0"
@@ -76,6 +89,20 @@ 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
+    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