I did mean what I had written, but changing to an array, per your
suggestion, led to the same thing.
bundle agent random_numbers {
vars:
"indices" slist => {
"00", "01", "02", "03", "04", "05", "06", "07", "08", "09",
};
"int[$(indices)]" int => randomint(0, 100);
reports:
cfengine_3::
"int[$(indices)] = $(int[$(indices)])";
}
[r...@gdcscf3lgmt02 inputs]# cf-agent -Kf /var/cfengine/inputs/random.cf
R: int[00] = 70
R: int[01] = 70
R: int[02] = 70
R: int[03] = 70
R: int[04] = 70
R: int[05] = 70
R: int[06] = 70
R: int[07] = 70
R: int[08] = 70
R: int[09] = 70
[r...@gdcscf3lgmt02 inputs]#
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Thursday, August 05, 2010 2:02 PM
To: [email protected]
Subject: Cfengine Help: Re: randomint issue
Forum: Cfengine Help
Subject: Re: randomint issue
Author: Seva Gluschenko
Link to topic:
https://cfengine.com/forum/read.php?3,17846,17850#msg-17850
As for me, the randomint works perfectly well (used in production to
spread snapshot requests through a pool of servers). Regarding your
example, it evaluates your variable only once. Perhaps, you meant
"int[$(indices)]" int => randomint(0, 100);
I'm not sure it'll work, though.
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine
This electronic communication and any attachments may contain confidential and
proprietary
information of DigitalGlobe, Inc. If you are not the intended recipient, or an
agent or employee
responsible for delivering this communication to the intended recipient, or if
you have received
this communication in error, please do not print, copy, retransmit, disseminate
or
otherwise use the information. Please indicate to the sender that you have
received this
communication in error, and delete the copy you received. DigitalGlobe reserves
the
right to monitor any electronic communication sent or received by its
employees, agents
or representatives.
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine