help-cfengine
[Top][All Lists]
Advanced

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

Re: Problem with configuration templates


From: Kai Großjohann
Subject: Re: Problem with configuration templates
Date: Fri, 01 Nov 2002 19:01:04 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Predrag Zecevic - Support Engineer <Predrag.Zecevic@2e-Systems.COM> writes:

> Many Solaris boxes havle slightly different conf files (for example
> Postfix main.cf). I have created generic main.cf (template) on MASTER
> server. Client box should detect that there is a newer copy on MASTER
> (cfexecd), take it and modify for local settings. After that, Postfix
> system should be restarted.

You could create the master file as a template which contains
placeholders such as @HOST@ (to be replaced with the host name).
Then you could proceed as follows:

Write an editfiles rule which looks for "#begin" and "#end" lines.
If they are not present, add them.  Now look for the "#begin" line,
delete everything up to (but not including) the "#end" line, then put
the contents of the master template between the "#begin"/"#end"
markers.  Finally, edit the file to replace all occurrences of @HOST@
with the host name and so on for all "variables" that you have.  Also
use the DefineClass action to define a restart_postfix class.  Then,
in the shellcommands section, add an action which depends on the
restart_postfix class which calls "/etc/init.d/postfix restart" or
whatever you need.

(This means that shellcommands should come after editfiles in the
actionsequence.) 

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






reply via email to

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