[cobbler] iterating of a list stored in ksmeta

James Cammarata jimi at sngx.net
Mon Mar 4 15:01:05 UTC 2013


On Mon, Mar 4, 2013 at 7:09 AM, Harry Hoffman <hhoffman at ip-solutions.net>wrote:

> Thanks guys,
>
> The typo was just in my email. But that code didn't work.
>
> What did was the following:
> #set uname = $users.split(",")
> #for $name in $uname
> user --name=$name
> #end for
>

In that case, you may want to use:

#set $uname = $getVar("users","").split(",")
#for $name in $uname
user --name=$name
#end for

I've tested this as follows:

$ cobbler system edit --name=test2 --ksmeta="users=test1,test2,test3"
$ cobbler system getks --name=test2 | grep name=test
user --name=test1
user --name=test2
user --name=test3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/cobbler/attachments/20130304/f1abef18/attachment.html>


More information about the cobbler mailing list