I'm not I'm understanding what you mean by class persistance. Do you mean
persistant over invokations of cf-agent?

Also, in your 'doesnt work' example, you need to show the classes body you
are using to make the class 'persistant'. I suspect the reason it doesn't
work is that definition of a scoped class (myclass) does not fall into the
categories of promise repaired, kept etc. But that is just a guess...

On 13/09/2010 11:22 PM, "Trond Hasle Amundsen" <t.h.amund...@usit.uio.no>
wrote:

Michael Potter <mega...@gmail.com> writes:

> I'm pretty sure modules can do what you want. They are...
Thanks for the suggestion, Michael. Modules may very well be the
answer. But if I understand modules correctly, they are just little
scripts/programs that are executed by Cfengine and return classes. Not
very unlike using stringcmp() and execresult() like in my example. Using
the module approach, I would have to maintain the persistance state in
the module script (state file or whatever), which is not ideal. I'm
trying to avoid this by making Cfengine remember the class.

What I don't understand about persistent classes is that I can't set the
persistance unless I actually use the class, i.e.:

Works:
------

 classes:
   "myclass" expression => <foo>;

 reports:
   myclass::
      "This works!",
      classes => <make myclass persistent>;

Doesn't work:
-------------

 classes:
   "myclass"
     expression => <foo>,
     classes => <make myclass persistent>;

 reports:
   myclass::
     "This doesn't work!";


This doesn't make sense to me...


Cheers,
-- 
Trond H. Amundsen <t.h.amund...@usit.uio.no>
Center for Information Technology Services...
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to