]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Don't try and install kernel modules when running tests
[chef.git] / cookbooks / hardware / recipes / default.rb
index 88bb45613da28f2043ad1b94c2a9869246723c8c..7f1431320dd389d532e6157db5852150965a720b 100644 (file)
@@ -540,16 +540,21 @@ if File.exist?("/etc/mdadm/mdadm.conf")
   end
 end
 
-template "/etc/modules" do
-  source "modules.erb"
-  owner "root"
-  group "root"
-  mode "644"
+file "/etc/modules" do
+  action :delete
 end
 
-service "systemd-modules-load" do
-  action :nothing
-  subscribes :restart, "template[/etc/modules]"
+node[:hardware][:modules].each do |module_name|
+  kernel_module module_name do
+    action :install
+    not_if { kitchen? }
+  end
+end
+
+node[:hardware][:blacklisted_modules].each do |module_name|
+  kernel_module module_name do
+    action :blacklist
+  end
 end
 
 if node[:hardware][:watchdog]