From b2d6edad947b3f485c210b874627906c31db0cc0 Mon Sep 17 00:00:00 2001 From: Norbert Varzariu Date: Sun, 20 Dec 2015 12:25:42 +0100 Subject: [PATCH] new function rand_from_array() returns a random element of an array --- manifests/config.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manifests/config.pp b/manifests/config.pp index 66efc60..79586b5 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -16,6 +16,14 @@ class rsnapshot::config ( ensure => 'directory', } + #$foo = ['1', '2', '3', '20..21'] + # $foo='*/5' + #$qax = rand_from_array($foo) + #notice("QAX is $qax ") + + + + # custom function, if only a hostname is given as a param, this is an empty hash # the next loop would break as puppet does not allow to reassign variables # the function checks $hosts for elements like: