]> git.openstreetmap.org Git - chef.git/commitdiff
Bring ramoth's watchdog under chef control
authorTom Hughes <tom@compton.nu>
Thu, 24 Jul 2014 10:01:02 +0000 (11:01 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 24 Jul 2014 10:03:16 +0000 (11:03 +0100)
cookbooks/hardware/attributes/default.rb
cookbooks/hardware/recipes/default.rb
roles/ramoth.rb

index 45b46a18a5fe178ae3aadd70281f42a4db7b70ef..8b794cab78df5e2e6396374215f90d7fdbce08bb 100644 (file)
@@ -19,3 +19,9 @@ if node[:kernel] and node[:kernel][:modules]
     default[:apt][:sources] |= [ "hwraid" ]
   end
 end
+
+if File.exists?("/proc/xen")
+  default[:hardware][:watchdog] = "xen_wdt"
+elsif node[:kernel][:modules].include?("i6300esb")
+  default[:hardware][:watchdog] = "none"
+end
index f6eb31ee396d3e7a2c8e0309fe01c4ff43afa625..689034a2abba002d4f057dccb4176ae981c855cf 100644 (file)
@@ -248,13 +248,7 @@ end
   end
 end
 
-if File.exists?("/proc/xen")
-  watchdog = "xen_wdt"
-elsif node[:kernel][:modules].include?("i6300esb")
-  watchdog = "none"
-end
-
-if watchdog
+if node[:hardware][:watchdog]
   package "watchdog"
 
   template "/etc/default/watchdog" do
@@ -262,7 +256,7 @@ if watchdog
     owner "root"
     group "root"
     mode 0644
-    variables :module => watchdog
+    variables :module => node[:hardware][:watchdog]
   end
 
   service "watchdog" do
index 17553f5d310d57caa5c8abefe556e80572c4fb35..6e1b71992b2e6e808a386185f8c0dc7053500e42 100644 (file)
@@ -27,6 +27,9 @@ default_attributes(
       }
     }
   },
+  :hardware => {
+    :watchdog => "w83627hf_wdt"
+  },
   :networking => {
     :interfaces => {
       :internal_ipv4 => {