help-cfengine
[Top][All Lists]
Advanced

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

Re: Strategy for "one-off" tasks


From: Adrian Phillips
Subject: Re: Strategy for "one-off" tasks
Date: Fri, 11 Jul 2003 08:59:45 +0200
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 (gnu/linux)

>>>>> "Daniel" == Daniel Pittman <daniel@rimspace.net> writes:

    >> We have a bunch of web servers that connect to a farm of
    >> database servers on the same private subnet, and the connection
    >> goes through a load balancer. The database servers need a
    >> static route set for each web server pointing to the load
    >> balancer, so the web server will get the reply back from the
    >> same IP it sent the request to (the load balancer). When we add
    >> a new web server, we need to add a route to each database
    >> server. Using "AppendIfNoSuchLine" works fine for adding to the
    >> init script, but we also need to run a shellcomand
    >> one-time-only to add the route now instead of on the next
    >> reboot (which is probably many months from now).

    Daniel> ...but you can achieve the same thing in a convergent
    Daniel> fashion by having cfengine define a class when the file is
    Daniel> changed, and then executing a shell command (or whatever)
    Daniel> that will ensure the routes are correctly installed.

    Daniel> I do this for management of the /etc/aliases file, and it
    Daniel> works just fine.

One problem with a define, possibly serious depending upon the command
to be run, is that if the cfagent is killed between the time a file is
edited and the shell command is run the action will be lost. The
chance that this may happen may be slim but it is possible. It would
be useful if there were a class of of persistent defines that could be
stored in the filesystem then removed later, for example at the
completion of a shellcommand.

The alternative is to flag defines based upon some other state which
can be get messy rather quickly.

Sincerely,

Adrian Phillips

-- 
Who really wrote the works of William Shakespeare ?
http://www.pbs.org/wgbh/pages/frontline/shakespeare/




reply via email to

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