help-cfengine
[Top][All Lists]
Advanced

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

Re: using cfrun to only take action on hosts in defined group


From: Ed Brown
Subject: Re: using cfrun to only take action on hosts in defined group
Date: Tue, 13 Dec 2005 17:51:45 -0700

On Wed, 2005-12-14 at 04:13, Steve Wray wrote:

>  I'm looking for a way to 
> run any actions which are already defined, from cfrun against a group of 
> hosts specified on the cfrun commandline.

Cfrun doesn't allow you to use classes (or 'groups') on the commandline
to define the hosts to connect to (if that is indeed the gist of your
question).  It's just not the way cfengine is architected.  The server,
or any node, can't know what classes any other node belongs to, or
conversely, what other nodes belong to any given class.  (Locally I have
added this functionality, but it involves a considerable amount of glue
(a module on the server that parses various teams' classes.cf files,
outputs a CSV type text file to be copied to each node, and a utility
script that can then derive the information) and site-specific
assumptions about file locations and formats.  Of course, information
about hard internal classes, or run-time conditional classes is still
unavailable this way.)

It seems though that you don't need this capability, at least not to
accomplish what you want in your example.  You have a working model, you
could use a more intuitive classname, like 'ShutdownXenInstances', so
that when you call cfrun, the commandline is more suggestive of what you
are doing:

groups:
       xeninstances = ( xeninstance1 xeninstance2 )
shellcommands:
    xeninstances.ShutdownXenInstances::
       "/bin/echo would halt this host"

and use:
cfrun -- -DShutdownXenInstances

-Ed

p.s. I'd be very interested in seeing details of your use of Xen: OS,
install and build procedures, how cfengine is involved... 





reply via email to

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