[Top][All Lists]

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

RE: Strategy for "one-off" tasks

From: Ferguson, Steve
Subject: RE: Strategy for "one-off" tasks
Date: Fri, 11 Jul 2003 08:20:19 -0400

Here's an example of one thing I want to do:

I have a software audit script.  It'll report all packages on the system
from a particular vendor.  I only want to run this once, get the output, and
send it off to the business types who have to reconcile it with invoices and

It's done maybe annually, if that often.  I only want it run when I'm
sitting there, at the keyboard, actually looking at the output.  So it's
essentially a once-only manual task.

I have a lot of other simple one-offs, mostly around harvesting information
about the systems, not actually changing configuration.  I can write a
script, then leverage the fact that I've got this nice trusted cfengine
infrastructure to push it out and execute it, returning the results to a
central location.

Because I have various classes of systems (production, development, qa),
they're not all configured the same.  cfengine deals with this nicely, but I
can't just say "Every system has 'product X' installed, and I have 100
systems, thus I know exactly what's running where."  I need a live check
that tells me what's out there.

Granted, any change to configuration should be defined in a convergent
manner.  Just because a configuration setting may only be performed once, it
doesn't mean I can't leave the check in there to check/correct/enforce it
periodically.  I agree that those sorts of things should be persistently

I think the notion of defining some sort of special class, to be invoked
with cfrun, is probably the best approach.

Thanks for all the input.


-----Original Message-----
From: Jamie Wilkinson [mailto:address@hidden
Sent: Friday, July 11, 2003 12:59 AM
To: 'address@hidden'
Subject: Re: Strategy for "one-off" tasks

This one time, at band camp, Ferguson, Steve wrote:
>I'm interested in hearing how people are applying cfengine to perform "one
>off" system management tasks.  It's fairly obvious how one would insert a
>new configuration task in on a recurring basis.  But how would you approach
>a task that you only want to execute one time?  I've got a few different
>ideas in mind, but I'd like to hear what other folks have been doing in
>practice before I commit to any one process.

Rethink your one-off task to instead be a "needs to happen if" task, for
example you need to run chkconfig if a service that should be running isn't

That way, cfengine will know when it needs to run your one-off task, and so
if you find your system unconverges, cfengine will sort it out for you the
second time too.

Use the shellcommands: section to run a command if you can't use the normal
FileExists and so on to define some class; like so:


        "/sbin/chkconfig --list vsftpd | grep off"

        "/sbin/chkconfig vsftpd on"

The test part gets run everytime, but the one-off task only ever gets called
once (or until someone manually intervenes -- at which point you will need
to run your one-off task again and magically cfengine will take care of it
for you)


Help-cfengine mailing list

reply via email to

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