|
From: | Tim Nelson |
Subject: | Re: editfile question |
Date: | Tue, 1 Mar 2005 09:34:07 +1100 (EST) |
On Mon, 28 Feb 2005, Sean Atkinson wrote:
On Sat, 2005-02-26 at 11:49 +0100, Sven Mueller wrote:John Borwick wrote on 25/02/2005 21:37:Sean Atkinson wrote: In my experience, for small "stateless" files like /etc/hosts, you can get away with EditFiles statements. For larger files, I would just copy them from your cfengine server.Other ways are to a) copy a template from the server, edit it to replace variables, copy to final destination. The last copy is only needed if you either - need the file to always be consistent or - need to take some action _only_ if the file actually changed. or b) copy some individual files from the server, concatenate themCopying the configuration files from a server also forces you to standardize on one (or a few) configurations, which IMHO is really helpful.Right. But that should be a side effect of using cfengine anyhow.Thanks for your responses. However I'm still not sure these techniques support how we need to modify the XF86Config file. The problem is that we'd like to take advantage of the installer's automatic configuration, which is customised to suit the local display hardware. Perhaps patching the configuration with a unified diff would allow my VNC additions to a basic file layout without conflicting with the installer's customisations. Then maybe cfengine could be responsible for distributing and maintaining this patch. However it all seems a bit of a hack and too unreliable for cfengine's purposes really. Would I be best off putting something together myself for this scenario?
In my experience, cfengine is so useful for systemwide config changes (ie. across all systems) that it's worth installing everywhere. Having done that, deploying a file and running a patch command are fairly straightforward.
You might also enjoy using cfengine-masterconf (with Perl Templates) for this. It's still in beta, though. Hopefully it should come out of beta in another week or two, though. http://sourceforge.net/project/showfiles.php?group_id=115927&package_id=137971&release_id=308142
That would make it easy to take care of the deployment part (just dump your file in /usr/etc/cfengine/classes/skel/any/usr/local/etc or wherever), and then you'd just need to add a statement (using cfedit) to any.cfa.pt that says:
shellcommands: any:: "diff ..."You'd need to put in the full path for diff, and you'd need to fill in the ... options appropriately, but the other two lines are fine.
:) -- Tim Nelson Server Administrator WebAlive Technologies Global Level 1 Innovation Building, Digital Harbour 1010 LaTrobe StreetDocklands, Melbourne, Vic, 3008
Phone: +61 3 9934 0812 Fax: +61 3 9934 0899 E-mail: tim.nelson@webalive.biz http://www.webalive.biz/ "Your Business, Your Web, Your Control"
[Prev in Thread] | Current Thread | [Next in Thread] |