]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Install haveged to avoid entropy starvation
[chef.git] / cookbooks / hardware / recipes / default.rb
index 0de7c69be1c04d04dcf72e0712fc5e96247370f7..a508fff6b55e7e3be4770a48f3469bb7e8a8de58 100644 (file)
@@ -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,6 +253,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"