[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
using cfrun to only take action on hosts in defined group
From: |
Steve Wray |
Subject: |
using cfrun to only take action on hosts in defined group |
Date: |
Wed, 14 Dec 2005 11:13:54 +1300 |
User-agent: |
Debian Thunderbird 1.0.2 (X11/20051002) |
Hi there,
We run xen servers and lots of xen virtual machines are now under
cfengine control, lovely :)
I'd like to be able to send a 'halt' to every xen instance on a
particular xen host.
It seems as if I should be able to do something like:
------------
control:
any::
actionsequence = ( shellcommands )
groups:
any::
# where these two hosts are instances on a xen server:
xeninstances = ( xeninstance1 xeninstance2 )
shellcommands:
xen3instances.Shutdown.Now::
"/bin/echo would halt this host"
alerts:
xen3instances::
"xen3 instance hit"
xen3instances.Shutdown.Now::
"xen3 instance shutting down"
-----------
and that I should be able to shut down only the hosts listed in
xen3instances by running:
cfrun -- -Dxen3instances.Shutdown.Now
what actually happens is that I get the alert:
"xen3 instance shutting down"
for every single host listed in cfrun.hosts
this would be bad...
If I use:
cfrun -- -DShutdown.Now
it works as expected, but seems unnatural... 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.
Eg, I already have a cfengine script to update debian packages, I want
to define a class of 'staging servers' and be able to run this existing
cfengine action against that group and no others.
Since I've already defined an action and I can add a group easily
enough, this would seem natural.
any ideas? I am guessing that I am missing something in the way that
cfrun operates? Should the group definitions go into cfservd.conf on the
cfserver or clients? cfagent.conf on the server or clients? Lots of
possibilities :)
Thanks!
--
There is nothing more important to good government than good education.
- using cfrun to only take action on hosts in defined group,
Steve Wray <=