help-cfengine
[Top][All Lists]
Advanced

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

Re: setting class based on file change


From: Luke A. Kanies
Subject: Re: setting class based on file change
Date: Wed, 5 Feb 2003 17:51:10 -0600 (CST)

On Thu, 6 Feb 2003, Jamie Wilkinson wrote:

> Although this doesn't help you immediately, I'd suggest using editfiles to set
> up your config files.  Attached it what I use for ssh.  I'm pretty proud of
> it... it's not perfect (I've discovered a few extra tricks that I've used in
> other cfengine inputs since) but it's pretty damn good, imo ;-)

Yeah, this is something I'm definitely interested in doing in the future;
creating all files from scratch, rather than just making piecemeal
changes.  It's just a big transition to start with.

Incidentally, this is also exactly the type of thing that should be
changed.  This ssh config file should work for nearly everyone who uses
ssh.  Or at least, it could be modified to do so.  In fact, I would modify
it to use variables set in a different file.  For instance:

ReplaceLineWith 'X11Forwarding no'

would become something like this:

control:
  allowredefinitionof = ( set )

# it annoys me you have to switch to groups...
groups:
  set = ( IsDefined(ssh_x11forwarding) )

control:
  !set:
     ssh_x11forwarding = ( "no" )

files:
  ...
  ReplaceLineWith 'X11Forwarding ${ssh_x11forwarding}'
  ...

Yeah, that's a bit nasty.  There are some changes in cfengine that could
make this much easier (such as support defining variables anywhere, and
support using IsDefined() places other than 'groups'), but it makes the
file much more generic.  You set up defaults in this file, override them
in your main config, and then just include this file at the end and your
file gets set up exactly as you want.

It's a lot of work to start, but once someone does it once, you can share
it so you can reuse that work.

Didn't a thread get started on sharing config files?  Whatever happened to
that?

-- 
    The Washington Bullets are changing their name.  The owners no
    longer want their team's name to be associated with crime.  So from
    now on the team will be known as The Bullets.
                -- Paul Harvey, quoting Argus Hamilton




reply via email to

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