From: Tom Hughes Date: Thu, 24 Jul 2014 10:01:02 +0000 (+0100) Subject: Bring ramoth's watchdog under chef control X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/01492948652e950f3a1335576a491aa8963e66e9?hp=dad78982f77fb5b8afc07bb3b7bbe6840ecec508;ds=sidebyside Bring ramoth's watchdog under chef control --- 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 => {