summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2011-02-01 16:47:10 -0800
committerPaul Berry <paul@puppetlabs.com>2011-02-01 16:47:10 -0800
commit9d452353f887fcd3c916db970eda4a67971eb4f3 (patch)
treed33e455f9f32b8cc36e8118875268f170f80efd0 /lib/puppet/parser/functions
parentbc6a4ef9a15db4a1f01e3fe4770789e48b827608 (diff)
parenta732a15a0fd43ce983474cae4c298a9bbd86329f (diff)
downloadpuppet-9d452353f887fcd3c916db970eda4a67971eb4f3.tar.gz
puppet-9d452353f887fcd3c916db970eda4a67971eb4f3.tar.xz
puppet-9d452353f887fcd3c916db970eda4a67971eb4f3.zip
Merge branch 'tickets/2.6.x/5564' into 2.6.next
* tickets/2.6.x/5564: Fixed #5564 - Added some more fqdn_rand documentation
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/fqdn_rand.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/puppet/parser/functions/fqdn_rand.rb b/lib/puppet/parser/functions/fqdn_rand.rb
index 3e7018ac4..52946f2c1 100644
--- a/lib/puppet/parser/functions/fqdn_rand.rb
+++ b/lib/puppet/parser/functions/fqdn_rand.rb
@@ -1,7 +1,10 @@
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|
+ "Generates random numbers based on the node's fqdn. Generated random values
+ will be a range from 0 up to and excluding n, where n is the first parameter.
+ The second argument specifies a number to add to the seed and is optional, for example:
+
+ $random_number = fqdn_rand(30)
+ $random_number_seed = fqdn_rand(30,30)") do |args|
require 'md5'
max = args.shift
srand MD5.new([lookupvar('fqdn'),args].join(':')).to_s.hex