CFEngine Help: Re: On persistent classes

2011-12-02 Thread no-reply
Forum: CFEngine Help Subject: Re: On persistent classes Author: sauer Link to topic: https://cfengine.com/forum/read.php?3,24095,24158#msg-24158 Well, if it's not gonna work, it should at least look pretty. :) In any event, I'd expect that a classes promise would be considered kept if

CFEngine Help: Re: On persistent classes

2011-12-02 Thread no-reply
Forum: CFEngine Help Subject: Re: On persistent classes Author: toddnni Link to topic: https://cfengine.com/forum/read.php?3,24095,24150#msg-24150 sauer, nice try and quite elegant too. This reminds me of my experiments which I did months ago, I tried to set a class using 'classes =>

CFEngine Help: Re: On persistent classes

2011-12-01 Thread no-reply
Forum: CFEngine Help Subject: Re: On persistent classes Author: sauer Link to topic: https://cfengine.com/forum/read.php?3,24095,24148#msg-24148 The classes body applies to all promise types, including class promises, right? I wonder what happens if you just specify a persist_time attribute in

CFEngine Help: Re: On persistent classes

2011-11-30 Thread no-reply
Forum: CFEngine Help Subject: Re: On persistent classes Author: toddnni Link to topic: https://cfengine.com/forum/read.php?3,24095,24109#msg-24109 To my understanding this is the only way currently. However this proposition https://cfengine.com/bugtracker/view.php?id=875 seems interesting

CFEngine Help: On persistent classes

2011-11-29 Thread no-reply
Forum: CFEngine Help Subject: On persistent classes Author: neilhwatson Link to topic: https://cfengine.com/forum/read.php?3,24095,24095#msg-24095 Persisting a class seems to be tied to a classes body. Suppose I want to persist a class defined in a classes section instead. Is this possible

Re: Cfengine Help: Re: Persistent classes

2010-09-14 Thread Trond Hasle Amundsen
menting. My thoughts exactly. Why outsource to external scripts when Cfengine can do the job. While for now this is merely of theoretical interest to me, I can imagine real-life scenarios where class persistence may prove to be a useful feature. >From what I can gather about persistent classes, it

Re: Cfengine Help: Re: Persistent classes

2010-09-13 Thread Paul Krizak
o the next >> 5-minute run will try again) while the "I was able to wget" class may >> have a persistence of several hours (and maybe a splayclass as well) to >> prevent hammering the target server. > > While I see the potential value of "persistent classes&quo

Re: Cfengine Help: Re: Persistent classes

2010-09-13 Thread Mike Hoskins
> 5-minute run will try again) while the "I was able to wget" class may > have a persistence of several hours (and maybe a splayclass as well) to > prevent hammering the target server. While I see the potential value of "persistent classes" -- I've always done th

Cfengine Help: Re: Persistent classes

2010-09-13 Thread no-reply
Forum: Cfengine Help Subject: Re: Persistent classes Author: neilhwatson Link to topic: https://cfengine.com/forum/read.php?3,18183,18213#msg-18213 You can set a different ifelapsed for any promise you like. body action if_elapsed(x) { ifelapsed => "$(x)"; expireafter =>

Re: Cfengine Help: Re: Persistent classes

2010-09-13 Thread Paul Krizak
5 Linux/Unix Systems Engineering Cell: (512) 791-0686 Global IT InfrastructureFax: (512) 602-0468 On 09/13/10 13:10, no-re...@cfengine.com wrote: > Forum: Cfengine Help Subject: Re: Persistent classes Author: > neilhwatson Link to topic: > https://cfengine.com/forum/rea

Re: Cfengine Help: Re: Persistent classes

2010-09-13 Thread Trond Hasle Amundsen
no-re...@cfengine.com writes: > Persistence for the sake of it. I can't argue that. Perhaps attempt > the wget command, and upon failure set a persistent class. However, I > can't see much benefit to this versus using ifelapsed to limit my wget > promise to once every four hours. Yeah, that ma

Cfengine Help: Re: Persistent classes

2010-09-13 Thread no-reply
Forum: Cfengine Help Subject: Re: Persistent classes Author: neilhwatson Link to topic: https://cfengine.com/forum/read.php?3,18183,18206#msg-18206 Persistence for the sake of it. I can't argue that. Perhaps attempt the wget command, and upon failure set a persistent class. However, I

Re: Cfengine Help: Re: Persistent classes

2010-09-13 Thread Trond Hasle Amundsen
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 ti

Cfengine Help: Re: Persistent classes

2010-09-13 Thread no-reply
Forum: Cfengine Help Subject: Re: Persistent classes Author: neilhwatson Link to topic: https://cfengine.com/forum/read.php?3,18183,18203#msg-18203 Forget all about classes and persistence for a moment. What are you trying to accomplish above that

Re: Cfengine Help: Re: Persistent classes

2010-09-13 Thread Trond Hasle Amundsen
no-re...@cfengine.com writes: > I think you want to change the class strcmp to a command action > instead. Then define the class as repaired or not. > http://www.cfengine.org/manuals/cf3-solutions.html Thanks Neil. I've been playing around with this. However, I'm a bit stuck. I have a command th

Re: Persistent classes

2010-09-13 Thread Trond Hasle Amundsen
Michael Potter writes: > I'm not I'm understanding what you mean by class persistance. Do you > mean persistant over invokations of cf-agent? Yes. The logic that defines the class is run every hour, but the resulting class lives on for 120 minutes or until it is reset by another run of the logic

Re: Persistent classes

2010-09-13 Thread Michael Potter
roach, 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

Re: Persistent classes

2010-09-13 Thread Trond Hasle Amundsen
ate 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 m

Cfengine Help: Re: Persistent classes

2010-09-13 Thread no-reply
Forum: Cfengine Help Subject: Re: Persistent classes Author: neilhwatson Link to topic: https://cfengine.com/forum/read.php?3,18183,18187#msg-18187 I think you want to change the class strcmp to a command action instead. Then define the class as repaired or not. http://www.cfengine.org/manuals

Re: Persistent classes

2010-09-13 Thread Michael Potter
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. On Mon, Sep 13,

Persistent classes

2010-09-13 Thread Trond Hasle Amundsen
Hi, I've been playing with class persistence recently. The idea is to run potentially heavy class-generating commands not too frequently, but being able to use those classes every time Cfengine runs. What I have now is this: bun