]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Modernise more LWRPs
[chef.git] / cookbooks / hardware / recipes / default.rb
index ebda56f43955589806a67d4a8739291163567ba5..472db1817a9dc838972684201a3f0b99f790c8ef 100644 (file)
@@ -21,7 +21,7 @@ include_recipe "tools"
 include_recipe "munin"
 
 ohai_plugin "hardware" do
-  template "ohai.rb.erb"
+  template_source "ohai.rb.erb"
 end
 
 case node[:cpu][:"0"][:vendor_id]
@@ -200,8 +200,17 @@ service "lldpd" do
   supports :status => true, :restart => true, :reload => true
 end
 
-# mcelog Daemon to log / alert on machine check events
 package "mcelog"
+
+%w[bus cache dimm iomca page socket-memory unknown].each do |trigger|
+  template "/etc/mcelog/#{trigger}-error-trigger.local" do
+    source "mcelog-trigger.erb"
+    owner "root"
+    group "root"
+    mode 0o755
+  end
+end
+
 service "mcelog" do
   action [:start, :enable]
   supports :status => true, :restart => true, :reload => false
@@ -415,7 +424,7 @@ if disks.count.positive?
   # an Areca controller as they only allow one thing to
   # talk to the controller at a time and smartd will
   # throw errors if it clashes with munin
-  disks = disks.reject { |disk| disk[:smart] && disk[:smart].start_with?("areca,") }
+  disks = disks.reject { |disk| disk[:smart]&.start_with?("areca,") }
 
   disks.each do |disk|
     munin_plugin "smart_#{disk[:munin]}" do