[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
budgeting.
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
handled.
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.
Steve
-----Original Message-----
From: Jamie Wilkinson [mailto:jaq@spacepants.org]
Sent: Friday, July 11, 2003 12:59 AM
To: 'help-cfengine@gnu.org'
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
configured.
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:
shellcommands:
vsftpd_server::
"/sbin/chkconfig --list vsftpd | grep off"
useshell=true
define=vsftpd_chkconfig
inform=false
vsftpd_chkconfig::
"/sbin/chkconfig vsftpd on"
useshell=false
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)
--
jaq@spacepants.org http://spacepants.org/jaq.gpg
_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://mail.gnu.org/mailman/listinfo/help-cfengine
- Re: Strategy for "one-off" tasks, (continued)
- Re: Strategy for "one-off" tasks, Frank Smith, 2003/07/10
- Re: Strategy for "one-off" tasks, Daniel Pittman, 2003/07/10
- Re: Strategy for "one-off" tasks, Adrian Phillips, 2003/07/11
- Re: Strategy for "one-off" tasks, Mark . Burgess, 2003/07/11
- Re: Strategy for "one-off" tasks, Jamie Wilkinson, 2003/07/11
- Re: Strategy for "one-off" tasks, Allen Bettilyon, 2003/07/11
- Re: Strategy for "one-off" tasks, David Douthitt, 2003/07/14
- Re: Strategy for "one-off" tasks, Jamie Wilkinson, 2003/07/14
RE: Strategy for "one-off" tasks,
Ferguson, Steve <=
Re: Strategy for "one-off" tasks, David Masterson, 2003/07/11
RE: Strategy for "one-off" tasks, Ferguson, Steve, 2003/07/11
RE: Strategy for "one-off" tasks, Ferguson, Steve, 2003/07/14
RE: Strategy for "one-off" tasks, Nielsen, Steve, 2003/07/14