help-cfengine
[Top][All Lists]
Advanced

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

1) $(allclasses} variable usage - 2) invoking parameters


From: Patrice GUERLAIS
Subject: 1) $(allclasses} variable usage - 2) invoking parameters
Date: Mon, 4 Dec 2000 11:49:11 +0100

Hi all,

I've problems using the ${allclasses} variable (cfengine 1.6.0a7). Here are my 
needs :
- I need to create a special class by executing a external command, which finds 
if already defined classes are part of filenames in
a special directory.
- that command should receive the already defined classes (or, better, the 
command line options).
- that command should be executed as early as possible while executing the cf 
configuration file.

For example, suppose you call cfengine with 'cfengine client1 client2', it 
should check in /special/dir if a file named
client1.anything or client2.something.else exists.

In order to achieve that, I wrote a small Perl script which returns 0 if any of 
the existing classes matches the condition, 1
otherwise.
The configuration file contains something like the following :
<cut>
classes:
        MY_SPECIAL_CLASS = ( "/my/perl/script.pl $(allclasses)" )
</cut>

It doesn't work because $(allclasses) doesn't seem to be defined when cfengine 
parses and executes the classes section, and
therefore, my script receives the string '$(allclasses)' as a parameter, and 
not the cfengine variable value.
What did I do wrong ? Did I totally misunderstood that variable usage ?

And, second part of the problem, is there a way to get the invoking paramaters 
? If cfengine is launched with 'cfengine param1
param2 ... paramN', how can I get the list 'param1 param2 ...' ?

Thanks for your help
Patrice

---
Patrice GUERLAIS
ECHO Interactive
20, Parc des Hautes Technologies
06250 MOUGINS (France)
+33.4.92.28.32.00 http://www.echo.fr
---




reply via email to

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