X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/8ad66df69a108a031ff4fb869f002a6598005649..c61bfd4788208f32a536d04c9e6b7c406d222f9f:/cookbooks/hardware/recipes/default.rb?ds=inline diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index f6eb31ee3..a508fff6b 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -148,6 +148,11 @@ template "/etc/initramfs-tools/conf.d/mdadm" do notifies :run, "execute[update-initramfs]" end +package "haveged" +service "haveged" do + action [:enable, :start] +end + if node[:kernel][:modules].include?("ipmi_si") package "ipmitool" end @@ -248,13 +253,48 @@ end end end -if File.exists?("/proc/xen") - watchdog = "xen_wdt" -elsif node[:kernel][:modules].include?("i6300esb") - watchdog = "none" +if File.exists?("/etc/mdadm/mdadm.conf") + mdadm_conf = edit_file "/etc/mdadm/mdadm.conf" do |line| + line.gsub!(/^MAILADDR .*$/, "MAILADDR admins@openstreetmap.org") + + line + end + + file "/etc/mdadm/mdadm.conf" do + owner "root" + group "root" + mode 0644 + content mdadm_conf + end + + service "mdadm" do + action :nothing + subscribes :restart, "file[/etc/mdadm/mdadm.conf]" + end +end + +template "/etc/modules" do + source "modules.erb" + owner "root" + group "root" + mode 0644 +end + +if node[:lsb][:release].to_f <= 12.10 + service "module-init-tools" do + provider Chef::Provider::Service::Upstart + action :nothing + subscribes :start, "template[/etc/modules]" + end +else + service "kmod" do + provider Chef::Provider::Service::Upstart + action :nothing + subscribes :start, "template[/etc/modules]" + end end -if watchdog +if node[:hardware][:watchdog] package "watchdog" template "/etc/default/watchdog" do @@ -262,7 +302,7 @@ if watchdog owner "root" group "root" mode 0644 - variables :module => watchdog + variables :module => node[:hardware][:watchdog] end service "watchdog" do