Hi, As far as I know, Cfengine does not treat bracket-named expressions as anything else than any other scalar/list. I.e. writing
"ip[R1]" ilist => { "1", "2", "3" }; has no different meaning than "abc" ilist => { "1", "2", "3" }; -- Regards, Eystein On Wed, Apr 7, 2010 at 10:31 AM, Сева Глущенко <seva.glusche...@gmail.com> wrote: > Hi guys, > > Trying to implement templated keepalived configuration, I've found > that it is impossible to iterate over a list in an array element. The > following example > > vars: > "ip[R1]" ilist => { "1", "2", "3" }; > "ip[R2]" ilist => { "4", "5", "6" }; > "r_id" string => "R1"; > > reports: > Yr2010:: > "IP: 10.0.0.$(ip[$(r_id)])"; > > produces output > > R: IP: 10.0.0.$(ip[R1]) > > The iteration itself is possible, i.e. it works like this: > > reports: > Yr2010:: > "IP: 10.0.0.$(ip[R1])"; > > producing the estimated > > R: IP: 10.0.0.1 > R: IP: 10.0.0.2 > R: IP: 10.0.0.3 > > Is the iteration depth reached? Did I miss anything? Is there any > solution to the problem? > > -- > SY, Seva Gluschenko, just stranger on The Road. > _______________________________________________ > Help-cfengine mailing list > Help-cfengine@cfengine.org > https://cfengine.org/mailman/listinfo/help-cfengine > _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine