X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/787079a2d0ae08e6a538f8e4f79c75488b8716f3..842193c1cb41f57515bb785120c61882eac99de4:/cookbooks/hardware/recipes/default.rb diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index c281c7fc8..857ad124d 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -267,7 +267,7 @@ if status_packages.include?("cciss-vol-status") end end -["cciss-vol-status", "mpt-status", "sas2ircu-status", "megaraid-status", "megaclisas-status", "aacraid-status"].each do |status_package| +%w[cciss-vol-status mpt-status sas2ircu-status megaraid-status megaclisas-status aacraid-status].each do |status_package| if status_packages.include?(status_package) package status_package @@ -353,6 +353,9 @@ disks = disks.map do |disk| munin = "#{device}-#{Regexp.last_match(1)}:#{Regexp.last_match(2)}" end end + elsif disk[:device] =~ %r{^/dev/(nvme\d+)n\d+$} + device = Regexp.last_match(1) + munin = device elsif disk[:device] device = disk[:device].sub("/dev/", "") munin = device @@ -368,7 +371,7 @@ disks = disks.map do |disk| ] end -disks = disks.compact +disks = disks.compact.uniq if disks.count.positive? package "smartmontools" @@ -532,3 +535,12 @@ unless Dir.glob("/sys/class/hwmon/hwmon*").empty? notifies :run, "execute[/etc/sensors.d/chef.conf]" end end + +if node[:hardware][:shm_size] + mount "/dev/shm" do + action [:mount, :enable] + device "tmpfs" + fstype "tmpfs" + options "rw,nosuid,nodev,size=#{node[:hardware][:shm_size]}" + end +end