help-cfengine
[Top][All Lists]
Advanced

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

RE: Optimizing large copies - actionsequence


From: Martin, Jason H
Subject: RE: Optimizing large copies - actionsequence
Date: Tue, 4 Oct 2005 14:35:33 -0700

> I concur with this. Cfengine insists on the correctness and 
> security of each operation -- and that takes time. A program 
> like rsync can achieve significantly better performance in 
> large copies if you have a trusted base.

How would one set up the actionsequence for this? The manual indicates
that I'd put in something like:
(
shellcommands.prepare
copy
shellcommands
.
.
.
)

shellcommands:
        prepare.xxxyy::
                "rsync -ar -e ssh sourcehost:/source /dest"

        !prepare.linux::
                "foobar"

        !prepare.aix::
                "fizbin"
        
        !prepare.someclass::
                "somecmd"
        
        [repeat endlessly]

However, that means that all of the shellcommands would necessarily have
to have a !prepare in their clause, which seems rather inelegant. Is
there a way (or can an enhancement be made) that will allow an action to
be called to only allow commands that have a certain class in their
name:

IE:
#############
actionsequence = (
shellcommands.+prep
copy
shellcommands
.
.
.
)

Shellcommands:
prep.linux::
        "rsync -arv sourcehost:/source/dir
/var/cfengine/repository/dest"

prep::
        "rsync -arv sourcehost:/some/other/dir
/var/cfengine/repository/otherdest"

Foo.bar::
        "something or other"

# Insert another 200 shellcommands here

copy:
        /source /dest...
#################

In the above example, all of the 'prep's would run on the first
shellcommands pass and the rest would run on subsequent passes.  I'm
primarily trying to avoid having to add a !prep clause to every
shellcommand. It would be too easy to forget it for one particular
command, especially with a large-scale configuration with multiple
people owning portions of the config.  It'd be much easier to support if
it were possible to explicitly specify that only certain subsections of
the config should run within a given pass, instead of having to
explicitly specify every portion that *shouldn't* run on a given pass.
Any suggestions?

Thank you,
-Jason Martin
 




reply via email to

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