[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: defining large groups by domain name
From: |
John Sechrest |
Subject: |
Re: defining large groups by domain name |
Date: |
Fri, 12 Mar 2004 07:06:12 -0800 |
I think this may be a version issue. What version are you using?
rader@ginseng.hep.wisc.edu writes:
%
% Ummm... using a module to define a classes in group: isn't working
% for me...
%
% $ hostname
% ginseng
% $ cat /var/cfengine/modules/HostMatch
% #!/usr/bin/perl
% if ( `hostname` =~ /$ARGV[0]/ ) { print "+$ARGV[1]\n"; }
% $ /var/cfengine/modules/HostMatch ginseng g3_node
% +g3_node
% $ cat cftest2
% #!/usr/sbin/cfagent --no-splay --inform --no-lock --file
% control:
% moduledirectory = ( /var/cfengine/modules )
% actionsequence = ( shellcommands )
% AddInstallables = ( specialclass )
% groups:
% g3_node_bugus = ( PrepModule(HostMatch, "ginseng g3_node") )
% shellcommands:
% g3_node:: "/bin/echo g3_node is defined"
% $ ./cftest2
% $
%
% ?
%
% I put some debug stmts in to try to figure this out, but I've
% forgotten exactly what the problem is. My recollection is that
% there's something special about group: actions.
%
% And, besides, they sytax above is ugly and I've already written
% the code for
%
% groups:
% g3_compute_nodes = ( HostRange(g3,01-35) )
%
% steve
% - - -
% systems & network guy
% high energy physics
% university of wisconsin
%
% > ---- Original Message ----
% > From: Brendan Strejcek
% > rader@ginseng.hep.wisc.edu wrote:
% >
% > > I tried writing a module but debug output makes me think that modules
% > > can only define macros--not groups.
% >
% > Modules can define classes or macros. Here is a simple sh module that
% > accomplishes what you want:
% >
% > #!/bin/sh
% >
% > hostname | cut -f1 -d. | egrep '^g3n([0-2][0-9]|3[012345])$' &&
% > echo +g3_compute_nodes
% >
% > For more details, read this:
% >
% > http://www.cfengine.org/docs/cfengine-Tutorial.html#Writing%20plugin%20mod
% > ules
% >
% > -- Brendan
%
%
%
% _______________________________________________
% Help-cfengine mailing list
% Help-cfengine@gnu.org
% http://mail.gnu.org/mailman/listinfo/help-cfengine
-----
John Sechrest . Helping people use
. computers and the Internet
. more effectively
.
. Internet: sechrest@peak.org
.
. http://www.peak.org/~sechrest
Re: defining large groups by domain name, John Sechrest, 2004/03/12
Re: defining large groups by domain name, Tod Oace, 2004/03/12