]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Make disk configuration more robust
[chef.git] / cookbooks / hardware / recipes / default.rb
index 3d1d8aa1986d2ea53842eb7a3c141bdda550883f..72b405c3f60168178f547832f41ead0d8276426b 100644 (file)
@@ -186,6 +186,8 @@ if File.exist?("/etc/default/grub")
   end
 end
 
+package "initramfs-tools"
+
 execute "update-initramfs" do
   action :nothing
   command "update-initramfs -u -k all"
@@ -475,7 +477,7 @@ disks = disks.map do |disk|
     munin = device
   end
 
-  next if device.nil?
+  next if device.nil? || munin.nil?
 
   Hash[
     :device => device,
@@ -536,7 +538,7 @@ if disks.count.positive?
   prometheus_collector "smart" do
     interval "15m"
     user "root"
-    capability_bounding_set %w[CAP_SYS_ADMIN CAP_SYS_RAWIO]
+    capability_bounding_set %w[CAP_DAC_OVERRIDE CAP_SYS_ADMIN CAP_SYS_RAWIO]
     private_devices false
     private_users false
     protect_clock false
@@ -700,7 +702,7 @@ prometheus_collector "ohai" do
   interval "15m"
   user "root"
   proc_subset "all"
-  capability_bounding_set "CAP_SYS_ADMIN"
+  capability_bounding_set %w[CAP_DAC_OVERRIDE CAP_SYS_ADMIN]
   private_devices false
   private_users false
   protect_clock false