1
Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc =>
2
"Generates random numbers based on the node's fqdn. The first argument
3
sets the range. The second argument specifies a number to add to the
4
seed and is optional.") do |args|
1
Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc =>
2
"Generates random numbers based on the node's fqdn. The first argument
3
sets the range. Additional (optional) arguments may be used to further
4
distinguish the seed.") do |args|
12
fqdn_seed = MD5.new(lookupvar('fqdn')).to_s.hex
7
srand MD5.new([lookupvar('fqdn'),args].join(':')).to_s.hex