puppet-standalone-mashup/shared/lib/puppet/parser/functions/dir_size.rb
2012-07-05 17:05:53 -04:00

7 lines
165 B
Ruby

module Puppet::Parser::Functions
newfunction(:dir_size, :type => :rvalue) do |path|
%x{df -m #{path}}.lines.to_a.last.strip.split(/ +/)[1].to_i / 4
end
end