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
]
end
-disks = disks.compact
+disks = disks.compact.uniq
if disks.count.positive?
package "smartmontools"
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