no-re...@cfengine.com writes: > Forget all about classes and persistence for a moment. What are you > trying to accomplish above that?
This isn't about accomplishing a defined task, as much as learning Cfengine and designing a clever framework for later use. Sorry to dissappoint, but for now persistent classes is exactly what I'm trying to achieve :) I found the stuff about persistence in the documentation and decided to give it a try. The idea of running potentially heavy tasks (e.g. once a day), but having the result of the last run of such as task at hand every time Cfengine runs appealed to me. There isn't currently a hands-on, practical problem that I'm trying to solve, but I can try to give a practical example of persistence usage: - We have a server directory which is maintained in a topic map. If a server is in this directory, certain promises should be kept by Cfengine. These include installing Munin client, Nagios plugins etc. If the server is not in the directory, these services should be disabled by Cfengine. - The server can 'wget <url>' to check if it is in this directory. The answer will be either "yes" or "no". (Redesigning this is on the todo list). Cfengine runs every 5 minutes, but we don't want to wget quite so often. Once a day is sufficient. We want Cfengine to take into account that '<url>' may be down at the time of checking, and don't want Cfengine to falsely assume that the server is not in the directory just because '<url>' is down. - For the sake of argument, lets assume that we have a poorly maintained and highly unstable yum repository which contains the Munin client and Nagios plugins. - If the yum repository is down at the time when Cfengine checks to see if the server is in the directory, we'll have to wait 24 hours before Cfengine tries to install the Munin client and Nagios plugins. - I'd rather have Cfengine remember the result of the directory check, and install the missing software as soon as the yum repository becomes available. This is where persistent classes are handy. This is all just hypothetical at the moment :) 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