help-cfengine
[Top][All Lists]
Advanced

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

RE: Module variables being set late


From: Wheeler, John
Subject: RE: Module variables being set late
Date: Wed, 7 Jan 2004 13:17:13 -0600

Nice ascii art. I have the same problem which is why I said I could
never engineer a solution to this using the second pass (also why I've
compiled 2nd pass out of my binary). 

<RANT>
I've never been a big fan of the non-deterministic nature of cfengine
(ok... somewhat of a misnomer as cfengine will always perform the same
actions based on the same config file, so I'm taking some liberty with
the dictionary meaning of non-deterministic), but trying to adding stuff
to cfengine that may get executed at some point that's not desirable
causes you to either over engineer something to force things to happen
(appending classes to action sequence) or create a bunch of classes that
provide an artificial dependency.
</RANT>
 

> -----Original Message-----
> From: Chip Seraphine [mailto:address@hidden
> Sent: Wednesday, January 07, 2004 1:00 PM
> To: Wheeler, John
> Cc: address@hidden
> Subject: Re: Module variables being set late
> 
> 
> Ugh.  I tried something like that, and it still didn't help-- what I
need
> to
> run prior-to is in an imported file.   (The "imports always run last"
> thing
> makes me nuts-- it isn't really last, and since it is outside of the
> actionsequence you can't control *when* it runs.)
> 
> So it looks like this:
> 
> cfagent.conf
>               |
>               |- cf.import1
>               |               \- Run MyModule which sets "MyModuleRan"
class
>               |
>               |-cf.import2
>                               \- Something that depends on
"MyModuleRan"
> 
> What I was hoping was that dotting the clas sonto the module action
line
> ("module:MyModule.someclass") would cause the reset of cfengine to get
the
> hint that this class's dependencies must run AFTER the module.  That
> doesn't
> seem to work.
> 
> Of course, the *real* fix would be if things just ran in the place
where I
> asked them to run.  I'm once again a victim of the multiple passes....
> 
> On Wednesday 07 January 2004 12:45, you wrote:
> > AFAICT this is what the 2nd pass is for. If you must have the module
run
> > before the other stuff in the action sequence, I *think*(1) you can
have
> > all the other items in your action sequence that need to have that
> > module run dependent on a class defined by that module. Then during
the
> > second pass you should see the actions fire.
> >
> > (1) I've had little luck *engineering* solutions that utilize this
> > feature.
> >
> > > -----Original Message-----
> > > From: Chip Seraphine [mailto:address@hidden
> > > Sent: Wednesday, January 07, 2004 11:21 AM
> > > To: address@hidden
> > > Subject: Module variables being set late
> > >
> > >
> > > I am running a module at the top of my actionsequence, and it sets
a
> >
> > class
> >
> > > ("foo").  Foo *is* an AddInstallable class.
> > >
> > > Unfortunately, the module runs only *after* everything else in the
> > > actionsequence, even though it is the first item on the list.
(I'm
> >
> > not
> >
> > > sure,
> > > but I believe that this is new behavior in 2.1; the problems this
> >
> > behavior
> >
> > > is
> > > causing did not exist prior to that.)  This is causing the "foo"
class
> >
> > to
> >
> > > not
> > > be set until too late to do any good.
> > >
> > > I've tried running the module the old-style way (with
> > > "module:modname.foo"),
> > > but that did not cause it run a the desired time.
> > >
> > > Any ideas?  Any way I can for the modules to run at the beginning
of
> >
> > the
> >
> > > first
> > > passs, which what I really need it to do?
> > >
> > >
> > > _______________________________________________
> > > Help-cfengine mailing list
> > > address@hidden
> > > http://mail.gnu.org/mailman/listinfo/help-cfengine





reply via email to

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