Aleksey,

one cannot iterate over foreign slist. You need to make a local copy:
bundle agent runme
{
 vars:
   "myusers" slist => { @(g.myusers) };
...
}

2011/5/28 Aleksey Tsalolikhin <atsaloli.t...@gmail.com>:
> What's wrong with this picture?
>
> I am trying to loop over the contents of @(myusers)
>
> I want to create home directories and add entries to /etc/sudoers
>
> However, I am unable to access the slist for an implicit loop:
>
> ------------------------------------------------
> body common control {
>        bundlesequence => {"runme"};
> }
>
> bundle common g
> {
> vars:
>
>   "crontab" string => "/var/spool/cron/crontabs/root";
>
> vars:
>    "myusers"  slist => { "joe", "mary", "ann" };
>
> }
>
>
> bundle agent runme
>
> {
> reports:
> linux::
>  "$(g.crontab)";
>  "$(g.myusers)";
> }
> ------------------------------------------------
>
> [cfengine00  ~]# cf-agent -f ./test.cf
> R: /var/spool/cron/crontabs/root
> R: $(g.myusers)
> [cfengine00  ~]#
>
> How do I loop over the g.myusers slist?
>
> Thanks,
> -at
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
>



-- 
SY, Seva Gluschenko.
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to