Jesse-

A very simple solution to your problem is to define the classes in a common 
bundle that gets executed before the agent bundle the defines the variables.  
It isn't convoluted, but it might be counterintuitive if you're used to a 
procedural language (and Cfengine is declarative, not procedural).

There can be more than one common bundle in your promises, you can name them 
whatever you like, and you can put the common bundle in the same file as the 
agent bundles (so you can package things up nicely).  It is easy, I have done 
it for lots of things...

-Dan

On Oct 8, 2010, at 8:21 AM, Jesse Becker wrote:

> On Thu, Oct 07, 2010 at 11:55:13AM -0400, no-re...@cfengine.com wrote:
>> Forum: Cfengine Help
>> Subject: Re: Force variables to be defined after classes?
>> Author: neilhwatson
>> Link to topic: https://cfengine.com/forum/read.php?3,18656,18657#msg-18657
>> 
>> On rare occasions normal ordering can hamper you.  When this happens to me a 
>> usually go back and look at what I'm trying to accomplish and look for 
>> another way.  You really don't want to try and change normal ordering.  
>> Really you don't.
> 
> I've run into several cases where either:
> 
>  1) defining variables a based on classes (in the first pass), or
>  2) having more than 3 iterations
> 
> would simplify some of my promises *immensely*.  That, or scrapping
> cfengine for doing that particular work, and calling a set of shell
> scripts to do it instead (but then, what's the point of running CF?).
> Workarounds are sometimes possible, but make the promises quite
> convoluted.
> 
> Simplicity, and passing the "least surprise" test, should rank very highly
> in systems like this, and the cfengine language prohibits it in this case.
> 
> 
> -- 
> Jesse Becker
> NHGRI Linux support (Digicon Contractor)
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to