[cobbler] iterating of a list stored in ksmeta

Andrew Hamilton ahamilton55 at gmail.com
Mon Mar 4 22:14:39 UTC 2013


On Mar 4, 2013 7:01 AM, "James Cammarata" <jimi at sngx.net> wrote:
>
> 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

Changing the way of inputting your data was the main part of my response
above. Sorry if that wasnt clear.

Also it doesn't seem that you need to use the $getVar() function with
ksmeta and can just call $users in the cheetah template code.

Andrew
>
>
> _______________________________________________
> cobbler mailing list
> cobbler at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/cobbler
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/cobbler/attachments/20130304/120597dc/attachment.html>


More information about the cobbler mailing list