]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Change mod_disk_cache to mod_cache_disk
[chef.git] / cookbooks / hardware / recipes / default.rb
index f6eb31ee396d3e7a2c8e0309fe01c4ff43afa625..8c587d9f0d172122c2818ab72f27b91f60926851 100644 (file)
@@ -248,13 +248,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 +297,7 @@ if watchdog
     owner "root"
     group "root"
     mode 0644
-    variables :module => watchdog
+    variables :module => node[:hardware][:watchdog]
   end
 
   service "watchdog" do