]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Increase size of /dev/shm on fume
[chef.git] / cookbooks / hardware / recipes / default.rb
index c281c7fc8e7ef91b2fc5e5677499d0ac75a2cbee..c8898f405d2ef818bf34b603d972b75e3c37e918 100644 (file)
@@ -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