On Thu, 2007-04-26 at 10:29 +0100, Mark McLoughlin wrote:
On Tue, 2007-04-24 at 14:53 -0400, John (J5) Palmieri wrote:
> One of the things we need to for OLPC from the LiveCD creator is the
> ability to output configuration files from a template.
One thing I've been meaning to do for a while, based on David
Lutterkort's suggestion, is to try using puppet[1] from the
livecd-creator ... i.e. run puppet from %post with a manifest that would
change whatever configuration files you need. One reason puppet might be
nice is that it does inheritance, templating etc.
I gave this a shot. What I did was:
- Packaged, in an RPM, a manifest for changing the iptables config
- Demonstrated a form of inheritance - i.e. there's a base iptables
configuration, and the manifest adds to that
- Installed puppet and the manifest RPM via the kickstart package list
- In %post, passed the manifest to puppet and then removed puppet
again
See the attached kickstart file and puppet files.
So, some comments:
- I don't want to have to require setting up a puppet server in order
to build images
- Having to package the manifest in an RPM sucks, we should probably
have support for copying the manifest into the chroot e.g.
$> livecd-creator -t raw -c ./test-image.ks -p iptables.pp --p myiptables.pp
- One reason why I include the iptables config inline in the puppet
manifest is that I don't like having stuff scattered over many
different files
- The main reason, though, is that I wanted the derived iptables
config to just add some rules rather than completely override the
entire config. Can we do something similar with templating?
- This is all fairly clunky, is there a better way?
Cheers,
Mark.