]> git.openstreetmap.org Git - chef.git/commitdiff
hardware: Set OSM ilo defaults
authorGrant Slater <git@firefishy.com>
Tue, 19 Jul 2022 17:57:57 +0000 (20:57 +0300)
committerGrant <github@firefishy.com>
Tue, 19 Jul 2022 19:41:08 +0000 (22:41 +0300)
cookbooks/hardware/recipes/default.rb
cookbooks/hardware/templates/default/ilo-defaults.xml.erb [new file with mode: 0644]

index 49af1f52eb069d672839c0ec40ebb27f6cf1d864..952729a007cf9664e2ad0fa252b230860f77e197 100644 (file)
@@ -59,6 +59,19 @@ case manufacturer
 when "HP"
   package "hponcfg"
 
+  execute "update-ilo" do
+    action :nothing
+    command "/usr/sbin/hponcfg -f /etc/ilo-defaults.xml"
+  end
+
+  template "/etc/ilo-defaults.xml" do
+    source "ilo-defaults.xml.erb"
+    owner "root"
+    group "root"
+    mode "644"
+    notifies :run, "execute[update-ilo]"
+  end
+
   package "hp-health" do
     action :install
     notifies :restart, "service[hp-health]"
diff --git a/cookbooks/hardware/templates/default/ilo-defaults.xml.erb b/cookbooks/hardware/templates/default/ilo-defaults.xml.erb
new file mode 100644 (file)
index 0000000..c4b62ec
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<RIBCL VERSION="2.0">
+  <LOGIN USER_LOGIN="admin" PASSWORD="password">
+    <SERVER_INFO mode="write">
+      <!-- Set Server Name -->
+      <SERVER_NAME VALUE="<%= node[:fqdn] %>"/>
+      <!-- 1 Operating system control mode -->
+      <!-- 2 HP Static Low Power mode -->
+      <!-- 3 HP Dynamic Power Savings mode -->
+      <!-- 4 HP Static High Performance mode -->
+      <SET_HOST_POWER_SAVER HOST_POWER_SAVER="3"/>
+      <!-- Set Auto Power ON -->
+      <!-- Set Auto Power after random delay -->
+      <!-- Both are required -->
+      <SERVER_AUTO_PWR VALUE="ON"/>
+      <SERVER_AUTO_PWR VALUE="RANDOM"/>
+      <!-- Unset max power cap -->
+      <SET_POWER_CAP POWER_CAP="0"/>
+    </SERVER_INFO>
+  </LOGIN>
+</RIBCL>