[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: defining large groups by domain name
From: |
rader |
Subject: |
Re: defining large groups by domain name |
Date: |
Fri, 12 Mar 2004 04:29:59 -0600 |
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
Re: defining large groups by domain name, John Sechrest, 2004/03/12
Re: defining large groups by domain name, Tod Oace, 2004/03/12