]> git.openstreetmap.org Git - chef.git/commitdiff
Modernise force loading of modules
authorTom Hughes <tom@compton.nu>
Mon, 8 Nov 2021 10:57:15 +0000 (10:57 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 8 Nov 2021 11:01:49 +0000 (11:01 +0000)
cookbooks/hardware/recipes/default.rb
cookbooks/hardware/templates/default/modules.erb [deleted file]

index 88bb45613da28f2043ad1b94c2a9869246723c8c..633edcb19cd2f1b74a53d5ca419a9a62256920c0 100644 (file)
@@ -540,16 +540,14 @@ 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
+  end
 end
 
 if node[:hardware][:watchdog]
diff --git a/cookbooks/hardware/templates/default/modules.erb b/cookbooks/hardware/templates/default/modules.erb
deleted file mode 100644 (file)
index 9ba59d2..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# DO NOT EDIT - This file is being maintained by Chef
-
-<% node[:hardware][:modules].each do |m| -%>
-<%= m %>
-<% end -%>