help-cfengine
[Top][All Lists]
Advanced

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

Re: Newbie question


From: Ted Zlatanov
Subject: Re: Newbie question
Date: Mon, 30 Jul 2001 16:51:17 -0400
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.104

Mark.Burgess@iu.hio.no writes:

> Every host needs a copy of the config which it can read. Best way
> is to copy it all from some central location:
> 
> copy:
> 
>   /masterfiles/cfengine.conf dest=/usr/local/cfengine/cfengine.conf
>    server=myhost

The problem I've found with that approach is that a syntax error in
the cfengine.conf file can prevent further copies from working.  Also,
you need cfd to run on the central server.

I use this instead (a slightly modified cfdaily from the distribution
examples).  You need to set up a rsync server on the mainhost
machine.  The actual rsync is very quick and reliable, not to mention
that it has a lot of useful options and allow/deny host rules.

The place where main-cfengine files live on mainhost should not be the
same as the CFINPUTS directory, so you can execute the same cfdaily
script on any machine.  Otherwise you need to do if-thens, and so on.

Ted


----------------------------

#!/bin/csh -f
###########################################
#
# Daily configuration check
#
###########################################
 
setenv prefix /usr/local
setenv exec_prefix ${prefix}
setenv CFINPUTS /etc/cfengine
setenv HOST `/bin/uname -n`
setenv CF_MAIN_HOST mainhost

setenv CF_RSYNC ${CF_MAIN_HOST}::main-cfengine

set path = ( /bin /usr/bin /usr/sbin $exec_prefix/bin )

if ( -f /etc/cfengine.pid ) then
 rm -f /etc/cfengine.pid
endif

if ( -x /usr/local/bin/rsync ) then
 echo Synchronizing via rsync with $CF_RSYNC
 /usr/local/bin/rsync -a $CF_RSYNC /etc/cfengine
endif

${exec_prefix}/sbin/cfengine $*




reply via email to

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