help-cfengine
[Top][All Lists]
Advanced

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

Re: Use of editfile to support templated configuration files


From: wbmccarty
Subject: Re: Use of editfile to support templated configuration files
Date: 14 Dec 2004 17:13:02 -0800
User-agent: G2/0.2

Hi Eric,

> I've read that page, and it seems quite useful, but I don't quite
> understand
> where the use of m4 would come in to play.

Each managed service must have several related cfengine script lines,
which occur in various sections, such as shellcommands and processes.
And, each stanza of script lines consists of perhaps half a dozen or
more lines. If you want to manage several dozen services, this entails
quite a few lines of cfengine script code. I prefer concise code, where
possible. So, I'm working on a way to automatically generate the
necessary cfengine script lines.

The m4 processor can support such an approach. You start with a file
that identifies the services to be managed. You then process this file
through m4, which generates the proper cfengine script lines for
shellcommands, processes, and other sections.

More generally, lots of pieces of a cfengine script can be generated
using m4. But, I haven't yet tried enough alternatives to know what
sort of architecture--that is, what files to have and what to put in
them--works best for even my own case, let alone more general cases.

It's also possible--even easy--to manage services using specially
constructed scripts invoked in the shellcommmands section, or using
external modules. But, until I feel that I know my way around cfengine,
I prefer to use its native functions where possible. Once I've got more
experience in doing so, I may feel more comfortable extending cfengine
functionality with scripts and modules. For me, a key advantage of
using m4 is that the generated script _is_ native cfengine, and could
have been generated just as effectively--though less efficiently--by
hand.

Cheers,



reply via email to

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