VMbuilder template several questions

юрка олейников yurkao at gmail.com
Mon Nov 15 00:32:27 UTC 2010

i want to create Virtual machine with config file, just calling :

> $ vmbuilder kvm ubuntu   -c vm.config -v --debug --templates
> /opt/templates/ --dest /srv/vms/zex

however i want also to create custom guest's apt/sources.list with my
additional PPA list by passing the list from config file ( and vmbuilder
will render my custom "ubuntu/sources.list.tmpl",
where each PPA is a well formed apt/source.list line, like:

> deb http://ru.archive.ubuntu.com/ubuntu/ lucid multiverse
> deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid multiverse

so the config file should contain both ( comma separated, or |-separatedl,
like pbuilder) lines.

so i deined my mirrors in [ubuntu] section of my config file

> my_mirrors=deb http://ru.archive.ubuntu.com/ubuntu/ lucid
> multiverse,deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid multiverse

however when running vmbuilder i've got an exception

>   File
> "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/ubuntu/dapper.py", line
> 324, in install_from_template
>     return self.context.install_from_template(*args, **kwargs)
>   File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/__init__.py",
> line 83, in install_from_template
>     return self.install_file(path,
> VMBuilder.util.render_template(self.__module__.split('.')[2], self.context,
> tmplname, context), mode=mode)
>   File "/usr/lib/python2.6/dist-packages/VMBuilder/util.py", line 156, in
> render_template
>     output = t.respond()
>   File "_home_yurii_vms_templates_ubuntu_sources_list_tmpl.py", line 98, in
> respond

my sources_list.tmpl:

> deb $mirror $suite #slurp
> #echo ' '.join($components)
> #if $my_mirrors
> #for $my_mirror in $my_mirrors
> $my_mirror
> #end for
> #end if

is that mean that i cannot define my own variables in config file?

Be Secure, Stay Open - live w/ OpenBSD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-server/attachments/20101115/70f03b7b/attachment.html>

More information about the ubuntu-server mailing list