help-cfengine
[Top][All Lists]
Advanced

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

Scheme for copying/editing config files?


From: Kai Großjohann
Subject: Scheme for copying/editing config files?
Date: Sat, 19 Oct 2002 16:58:48 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

To make things easier, I think of classes as a tree.  As an example,
we might have this tree (Emacs outline mode syntax):

* all
** linux
*** linux_desktop
**** host patty
**** host lucy
*** linux_laptop
**** host sally
**** host marcie
** solaris
*** solaris_server
**** host bonny
*** solaris_desktop
**** host gondor

I hope this is clear.  Now we have a number of config files, and
different parts of the config files apply to different subtrees of
the whole class tree.

Writing separate lines in the copy section of the cfengine (2) config
for every single case gets quite boring after a while.  Is there an
automatic mechanism which can choose the right files to install
without a separate line for each file and each host or class?

For example, given the following files:

    linux/etc/apt/sources.list
    linux_desktop/etc/X11/XF86config
    patty/etc/apt/sources.list

cfengine should know, when run on patty, to copy files 2 and 3.  And
it should be sufficient to just add a new file with the right name.
So after adding linux/etc/postfix/main.cf, this file should also be
copied for patty.

Extra credit if you have a solution in the case where parts of the
config files apply in some cases.

So far, we have been working around it by having sections in config
files designated by "#begin foo" and "#end foo" markers, and we put
stuff in the editfiles statement to add/update those config file
sections.

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)






reply via email to

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