From 01492948652e950f3a1335576a491aa8963e66e9 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 24 Jul 2014 11:01:02 +0100 Subject: [PATCH 1/1] Bring ramoth's watchdog under chef control --- cookbooks/hardware/attributes/default.rb | 6 ++++++ cookbooks/hardware/recipes/default.rb | 10 ++-------- roles/ramoth.rb | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cookbooks/hardware/attributes/default.rb b/cookbooks/hardware/attributes/default.rb index 45b46a18a..8b794cab7 100644 --- a/cookbooks/hardware/attributes/default.rb +++ b/cookbooks/hardware/attributes/default.rb @@ -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 diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index f6eb31ee3..689034a2a 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -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 diff --git a/roles/ramoth.rb b/roles/ramoth.rb index 17553f5d3..6e1b71992 100644 --- a/roles/ramoth.rb +++ b/roles/ramoth.rb @@ -27,6 +27,9 @@ default_attributes( } } }, + :hardware => { + :watchdog => "w83627hf_wdt" + }, :networking => { :interfaces => { :internal_ipv4 => { -- 2.43.2