From: Tom Hughes Date: Mon, 4 Aug 2014 07:29:43 +0000 (+0100) Subject: Send mdadm notification to the admins list X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/8aa8deeba6d6e4838c5276f1878a2afafab2fdc9?ds=sidebyside Send mdadm notification to the admins list --- diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 0de7c69be..8c587d9f0 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -248,6 +248,26 @@ 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"