help-cfengine
[Top][All Lists]
Advanced

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

Re: Puzzler: Can cfengine replace make?


From: Steve Traugott
Subject: Re: Puzzler: Can cfengine replace make?
Date: Tue, 6 Nov 2001 20:46:36 -0800
User-agent: Mutt/1.2.5i

On Tue, Nov 06, 2001 at 08:22:08AM -0700, Jon Stearley wrote:
> > symlink will be set once, ntpdate will run, and then xntpd will be
> > installed once, at first boot only, for the life of the machine.  Make
> > sense?
> > 
> > But ntpdate will still run every time, at each subsequent boot.  Still
> > make sense?
> > 
> > Now, here's the question:  Can anyone see a way to do this once-only
> > type of action cleanly in cfengine?  I've tried several different ways
> > over the years, but I've never been satisfied with the results.  
> 
> my approach has been to use the same mechanism - the existence (or
> update) of certain files.  instead of "touch"ed files, i tend to pick
> something critical to the package itself.  ie:
> 
> -------------- snippet from cf.webserver -------------------------
> groups:
>     install_apache = ( '/usr/bin/test ! -e /usr/sbin/apachectl' )
> 
> copy:
>     # ps, in cfengine.conf i've got: DefaultCopyType = ( byte )
>     $(webdir)/apache/ dest=/etc/apache/ recurse=inf define=apache_changed
> 
> shellcommands:
>   install_apache::
>     "/usr/bin/yes no | apt-get install libmm10 apache-common apache libapach 
> e-mod-ssl libapache-mod-ssl-doc analog"
>   apache_changed|php4_changed|jserv_changed::
>     "/etc/init.d/apache restart"
>     "/etc/init.d/jserv restart"
> ------------------------------------------------------------------
> 
> in this way, the needed packages are installed once, and restarted
> when appropriate (ie- their configs change).  this and other examples
> can be found in the stuff i wrapped up in february (not updated
> since), at ftp://ftp.cs.unm.edu/pub/jstear/example_infrastructure.tar.gz

I like this method better than trying to use stampfiles in cfengine,
though it does require more careful thought -- "What's something
unique to this version of this package that I can test for?" 

This means a little more work when, say, upgrading from one version of
an application to another, but you do get the advantage of a more
intelligent algorithm out of the deal.

I really like the 'apache_changed|php4_changed|jserv_changed' syntax
-- it lets dependency graphs diverge and reconverge.  Make can't do
that as cleanly.

Steve
-- 
                        .       .    `   *    
Steve Traugott   ` .  *  +                       
Infrastructure Architect            + `     
address@hidden    '   *  .   '  +`   *   
http://www.stevegt.com/

Attachment: pgpt9OdENtvH6.pgp
Description: PGP signature


reply via email to

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