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

> I'm pretty sure modules can do what you want. They are programs that
> are executed by cfengine, and return in serialized form a stream of
> classes to be defined (or undefined). You can make that program as
> smart or dumb as you want, and simulate things
> like persistent classes.

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, University of Oslo
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to