Sha256: 4a5dff4e63d9b566ede98c3efeec770e4ca66fb2352d8b5ebf2995cea1283649
Contents?: true
Size: 385 Bytes
Versions: 5
Compression:
Stored size: 385 Bytes
Contents
Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc => "Generates random numbers based on the node's fqdn. The first argument sets the range. Additional (optional) arguments may be used to further distinguish the seed.") do |args| require 'md5' max = args.shift srand MD5.new([lookupvar('fqdn'),args].join(':')).to_s.hex rand(max).to_s end
Version data entries
5 entries across 5 versions & 1 rubygems