[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

edit and copy

From: Steve Wray
Subject: edit and copy
Date: Fri, 28 May 2004 10:53:26 +1200
User-agent: KMail/1.6.1

Hi there,
I am working on a centralised management system for a collection of 

One thing in particular that I'm wondering about is localising files.

The system I've developed so far uses cfengine and subversion together, 
such that cfengine checks out and updates a local working copy of /etc 
which cfengine then copies into place. 

cfengine also maintains permissions and ownerships of files based on 
subversion properties; I have some perl scripts which read the svn 
properties, sets them on files and directories and creates .cf files so 
that cfengine can continue to maintain them when they go live.

This is ok but now I need to go one step further; currently the 
subversion repository does not contain any files which require 

Ideally, the repository would contain such files (eg /etc/hosts) and 
these would go into the working copy on the workstation and cfengine 
would copy these into the live /etc directory (or wherever) modifying 
them on the way; I don't want the files in the local svn working copy 
to be modified and I don't want the unaltered files going into the 
live /etc and then being modified, rather the files should be modified 
in transit.

I have found cfperl which looks promising, but I would really rather not 
introduce yet another layer. If possible I would like to do this purely 
in cfengine.

I've found the editfiles component of cfengine baffling to say the 

So far, the only thing I can think of is to have cfengine call perl 
scripts via shellcommands but this seems a bit heavy-handed.

For example, /etc/hosts needs to be modified for each system, having 
mostly the same entries but with the entry for the target host 
localised and a entry for its printer.

ie, the generic hosts file would contain (among other, static, things); hostname
network.100  localprinter

cfengine should note the hostname for this machine and its actual IP 
address and alter these values to, eg;  workstation128  localprinter

where the IP of the local printer is always the network address of the 
host and at .100

Any suggestions? (other than RTFM, which I have been doing fairly 
regularly since starting this project).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]