]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Start serial console on ttyS2 for OVH machines
[chef.git] / cookbooks / hardware / recipes / default.rb
index 35e31ea2e2fc3d644e78dcba19f7c1434aaf714b..f9f76cd46dc11fadc87f3e7d2fdb98d9ef22a58f 100644 (file)
@@ -31,9 +31,7 @@ end
 
 case node[:cpu][:"0"][:vendor_id]
 when "AuthenticAMD"
-  if node[:lsb][:release].to_f >= 14.04
-    package "amd64-microcode"
-  end
+  package "amd64-microcode" if node[:lsb][:release].to_f >= 14.04
 end
 
 if node[:dmi] && node[:dmi][:system]
@@ -54,12 +52,27 @@ units = []
 
 if node[:roles].include?("bytemark") || node[:roles].include?("exonetric")
   units << "0"
+elsif node[:roles].include?("ovh")
+  units << "2"
 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 "--force-yes"
+    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"
@@ -78,19 +91,10 @@ end
 
 # Remove legacy HP G4 support which breaks modern hp-health 10.4
 if manufacturer == "HP"
-  file "/opt/hp/hp-health/bin/hpasmd" do
-    action :delete
-  end
-  file "/usr/lib/libhpasmintrfc.so.3.0" do
-    action :delete
-  end
-
-  file "/usr/lib/libhpasmintrfc.so.3" do
-    action :delete
-  end
-
-  file "/usr/lib/libhpasmintrfc.so" do
-    action :delete
+  %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
@@ -180,9 +184,7 @@ service "haveged" do
   action [:enable, :start]
 end
 
-if node[:kernel][:modules].include?("ipmi_si")
-  package "ipmitool"
-end
+package "ipmitool" if node[:kernel][:modules].include?("ipmi_si")
 
 if node[:lsb][:release].to_f >= 12.10
   package "irqbalance"