]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Add basic watchdog support for VMs
[chef.git] / cookbooks / hardware / recipes / default.rb
index 59a078894b9cebbee5c053c27ec5927546a9beb9..7923d3868d0213e8114ba0225c3628c78f9a2fac 100644 (file)
@@ -247,3 +247,25 @@ end
     end
   end
 end
+
+if File.exists?("/proc/xen")
+  watchdog = "xen_wdt"
+elsif node[:kernel][:modules].include?("i6300esb")
+  watchdog = "none"
+end
+
+if watchdog
+  package "watchdog"
+
+  template "/etc/default/watchdog" do
+    source "watchdog.erb"
+    owner "root"
+    group "root"
+    mode 0644
+    variables :module => watchdog
+  end
+
+  service "watchdog" do
+    action [ :enable, :start ]
+  end
+end