It'd be useful to be able to specify a proxy (or even a mirror).
E.g. in https://github.com/jedi4ever/veewee/blob/master/templates/scientificlinux-6.2-x86_64-netboot/ks.cfg the url and repo lines are hardcoded to arbitrary mirrors.
It'd be useful to able to configure it to use a local proxy and/or mirror so that when I have a local source (e.g. I use apt-cacher) I can use it.
Both url and repo lines can receive proxy's to use:
url ... --proxy=[protocol://][username[:password]@]host[:port]
repo ... --proxy=[protocol://][username[:password]@]host[:port]
You're right; though there is no generic answer to this: If there is a mirror list we might be able to do something similar to the gentoo - See de90a8b
As for the proxy, yup, maybe we can pass them as environment vars. It would help if you changed an existing template to one that uses a proxy. Then I can use it as a template for search/replace values.
I didn't realise when I posted this issue originally that I could just edit the created definition structure (facepalm), so I've got a work around that's pretty comfortable now.
Having a mirror list doesn't actually quite solve the problem I was dealing with.
What I'm trying to do is have a caching/mirroring proxy (e.g. apt-cacher-ng) enabled that I can then build the base box through (on my connection this is orders of magnitude faster for common builds).
I ended up solving the problem by saving the generated definition layout in my repo and putting a bash script around it that runs a regex over a template version of ks.cfg to replace the proxy and mirror components:
I'm not sure if this is useful enough to be absorbed in to the template some how.
One option might be if there was a way to put files in the definition template that were .irb files that could resolve to variables specified in definitions.rb, or as CLI arguments - I'm currently preparing some .template files in that directory and pre-processing them with bash before letting VeeWee have them (e.g. to create a cacheable VirtualBox Guest additions installer https://github.com/neerolyte/vagrant-matrix/blob/master/definitions/sl6/virtualbox.sh.template and for the kick start https://github.com/neerolyte/vagrant-matrix/blob/master/definitions/sl6/ks.cfg.template).
I would be interested in this as well. I'm sure @neerolyte's solution would work, but if possible it would be nice to not have to change the default templates to build with a specific mirror.
postinstalls can now be .erb files and with params you can now pass environment vars to postinstall scripts.
See for example - https://github.com/jedi4ever/veewee/blob/master/templates/ubuntu-12.10-server-i386-packages/chef.sh
so if the templates are generically written this can work. But I won't spend time on it right now
Sorry for poking something old but wondering if you can check the example link?
You mention we can now use .erb files, but the linked example isn't an erb file.