X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/01492948652e950f3a1335576a491aa8963e66e9..b8b28fe06033fec880ba9b179e63387ed5a70fa0:/cookbooks/hardware/recipes/default.rb diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 689034a2a..8c587d9f0 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -248,6 +248,47 @@ end end end +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 node[:hardware][:watchdog] package "watchdog"