Re: Matching host names by regexp

2010-04-21 Thread Erlend Leganger
On 21 April 2010 17:48, Justin Lloyd wrote: > FWIW, for scalability I'd probably use $(sys.uqhost) to ensure that > classmatch is not matching against another class that may exist and just > happens to look like a valid hostname. > > classes: > "svxx" expression => regcmp("sv[0-9]{2}", "$(sys.uq

Re: Cfengine Help: Re: RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Jesse Becker
On Wed, Apr 21, 2010 at 05:42:14PM -0400, Lebel, Marco wrote: >Justin, > >You are bringing an interesting point since I struggle with classes in this >context. But I have not done any structured testing but I am under the >impression that once a class has been set it never gets unset. Actually,

Re: Cfengine Help: Re: RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Jesse Becker
On Wed, Apr 21, 2010 at 06:16:11PM -0400, Justin Lloyd wrote: >Dan, > >The part about classes being stored in a database has me confused. I >thought that classes were in-memory for each run of a component >(cf-agent, cf-serverd, etc.). Are you saying classes are something like >a shared value betwe

Re: Cfengine Help: Re: RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Jesse Becker
On Wed, Apr 21, 2010 at 05:42:14PM -0400, Lebel, Marco wrote: >Justin, > >You are bringing an interesting point since I struggle with classes in this >context. But I have not done any structured testing but I am under the >impression that once a class has been set it never gets unset. I believe

Re: Cfengine Help: Re: RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Jesse Becker
On Wed, Apr 21, 2010 at 05:31:01PM -0400, Justin Lloyd wrote: >As I understand it, it will reevalute the class promise, and therefore >check for the file's existence, on all three iterations. A good way to From what I've seen, this is correct. But once a promise has been fulfilled, it is not exe

RE: Cfengine Help: Re: RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Justin Lloyd
Marco, It appears you are correct. Given this test file: body common control { bundlesequence => { "test" }; inputs => { "cfengine_stdlib.cf" }; } bundle agent test { vars: "myfile" string => "/tmp/foo"; classes: "file_exists" expression => fileexists("$(myfile)"

RE: Cfengine Help: Re: RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Justin Lloyd
Dan, The part about classes being stored in a database has me confused. I thought that classes were in-memory for each run of a component (cf-agent, cf-serverd, etc.). Are you saying classes are something like a shared value between the components, rather than each component essentially having its

Re: Cfengine Help: Re: RE: Cfengine Help: cfengine program flow

2010-04-21 Thread daniel . klein
Kinda-sorta :-) Classes that are defined in a "common" bundle are global. Classes that are defined in any other kind of bundle are local to that bundle. See section 1.6 of the manual. Likewise, classes are cached with an expiration time, but they do go away. Although they can be set with a test

RE: Cfengine Help: Re: RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Lebel, Marco
Justin, You are bringing an interesting point since I struggle with classes in this context. But I have not done any structured testing but I am under the impression that once a class has been set it never gets unset. Again I want to stress that I never did any exhaustive testing on this but I

RE: Cfengine Help: Re: RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Justin Lloyd
As I understand it, it will reevalute the class promise, and therefore check for the file's existence, on all three iterations. A good way to see what is happening is to run cf-agent in verbose mode (cf-agent -vK) and write its output to a file then read through it. You'll see lines like this (your

RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Justin Lloyd
I forgot to reply to your second question. Cfengine's design will cause it to converge to the state defined in your policy over time. So depending on what's in your policy, it will likely take several agent runs before a system converges to the defined state. Separating promises into bundles is use

Cfengine Help: Re: RE: Cfengine Help: cfengine program flow

2010-04-21 Thread forum
Forum: Cfengine Help Subject: Re: RE: Cfengine Help: cfengine program flow Author: nicolas Link to topic: https://cfengine.com/forum/read.php?3,16959,16960#msg-16960 thanks for the fast response. it helps, i thought this is a recommendation :-/ (i should read more exactly) but one question i sti

RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Justin Lloyd
Nicolas, Cfengine evaluates all bundles as they are ordered within the bundlesequence. Within each bundle, it evaluates the promise types in the following order (from section 2.8.1 in the reference manual): vars classes interfaces processes storage

RE: Cfengine Help: cfengine program flow

2010-04-21 Thread Lebel, Marco
Hello Nicolas, To answer: 1) section 2.8 Normal ordering) of cf-engine reference book (no it is not top down) but packages are before commands and it will loop 3 times. 2) There are many reasons for a promise not to be kept without the promises at hand it is hard to say but it is possible that

Cfengine Help: cfengine program flow

2010-04-21 Thread forum
Forum: Cfengine Help Subject: cfengine program flow Author: nicolas Link to topic: https://cfengine.com/forum/read.php?3,16957,16957#msg-16957 hi I thought i understand the program flow of cfengine more or less, but today i recognized i really don't :-/ I hope anybody can helpe me to clear a f

Re: Question on FileExists and imports when upgrading from CF2 to CF3.

2010-04-21 Thread Mark Burgess
you'll need to upgrade. Tom Van de Velde wrote: > Hi, > > Thanks for the reply I tried that but got an error and he is falling back to > failsafe > > cf3:/var/cfengine/inputs/promises.cf:7,32: Constraint lvalue > ignore_missing_inputs is not allowed in 'common' constraint body, near token >

RE: Solaris 10 Cfengine SMF service

2010-04-21 Thread Justin Lloyd
David, Sorry I've taken so long to respond to this. * I'll use my new test environment to move the actions into the xml file as you've done. Eliminating the method script is certainly appealing since zones slightly complicate matters, requiring a manifest file per zone but all zones sharing a sin

Re: Question on FileExists and imports when upgrading from CF2 to CF3.

2010-04-21 Thread Tom Van de Velde
Hi, Thanks for the reply I tried that but got an error and he is falling back to failsafe cf3:/var/cfengine/inputs/promises.cf:7,32: Constraint lvalue ignore_missing_inputs is not allowed in 'common' constraint body, near token 'true"' Can't stat file "/var/cfengine/inputs/cf3.framework" for p

RE: Matching host names by regexp

2010-04-21 Thread Justin Lloyd
FWIW, for scalability I'd probably use $(sys.uqhost) to ensure that classmatch is not matching against another class that may exist and just happens to look like a valid hostname. classes: "svxx" expression => regcmp("sv[0-9]{2}", "$(sys.uqhost)"); Justin -Original Message- From: he

Copying active binaries in cfengine 2

2010-04-21 Thread Michael Durket
Suppose I have a program that is executed via xinetd (or inetd) and suppose there is an active copy running. Further suppose that there's a newer version of this binary that cfagent is actively copying. Since copying over the currently running binary could cause the running version to fail, how

Re: anybody succeed with installing FreeBSD packages locally?

2010-04-21 Thread Nakarin Phooripoom
Did you tell cfengine to use that env variable? body agent control { freebsd:: environment => { "PKG_PATH=/tmp/packages/All" }; } or you should possibly use 'package_file_repositories' in the body package_method. Cheers, --Nakarin On Apr 21, 2010, at 11:28 AM, Сева Глущенко wrote: > Hello

anybody succeed with installing FreeBSD packages locally?

2010-04-21 Thread Сева Глущенко
Hello folks, I'm tryin' to build a Cfengine method which installs locally available packages. Unfortunately, it seems like pkg_add ignores PKG_PATH environment variable despite it is listed in its manual page and "strings /usr/sbin/pkg_add" command output. So, is there anybody who succeed with thi

Re: Matching host names by regexp

2010-04-21 Thread Erlend Leganger
Perfect, why didn't I think of that - nice and simple. With this and a more precise (and less readable) regexp, I now have the following: classes: "svxx" expression => classmatch("sv[0-9]{2}"); #sv00, sv01, ..., sv99 Thanks, Erlend On 21 April 2010 08:57, Mark Burgess wrote: > > Sorry, I f