Iterations for convergence : vars do not iterate

2010-03-05 Thread lefollfr
Hello, Iterations do not behave as expected for vars sections, in my opinion at least, because vars section seems to be evaluated only once. - The manual cf3 Reference Manual explains (2. A simple crash course in concepts / 2.8 Normal ordering) : "Within a bundle, the promise types are executed

Re: Indexing an array of slist?

2010-03-05 Thread daniel . klein
The quick answer is "you don't". The longer answer is: an slist (or ilist or rlist) can only be iterated over in it's entirety by referencing the list as a scalar (and then cfengine iterates over the whole list automagically). You can index an array (which is what 'foo' is in your example), but a

Re: Version control best practices?

2010-03-05 Thread Tim Cutts
On 5 Mar 2010, at 7:47 am, Bas van der Vlies wrote: > > On Mar 5, 2010, at 12:52 AM, Jessica Greer wrote: > >> Thanks to everyone for the responses - that's helpful. Tim, I >> especially like your idea of mailing out diffs, so everyone stays in >> the loop, and teammates don't have to aler

Re: Basic string replacement

2010-03-05 Thread daniel . klein
Because it is a declarative promise language - which is somewhat different than the usual imperative programming language model. A fine point, but different nontheless. Declarative languages are hard to get your head around if you think in purely imperative terms. Once you "let go" and allow you

Re: loadays

2010-03-05 Thread Nicolas Charles
Hello, Jonathan Clarke and I will attend and make a presentation about cfe (at least, we hope it'll be accepted). By the way, is anybody familiar with what they expect ? I guess it's a rather technical presentation that is expected, but I'd like to be sure about it... Regards, Nicolas Mark Bu

Re: loadays

2010-03-05 Thread Fabrice Flore-Thebault
Great news ! The intended audience is : sysadmins. And quoting one of the organisators : "it's not like fosdem where we want the core developers of a project to present ... it's more about what/ how/why and using it ... :)" Cheers, f. On 5/03/2010 12:09, Nicolas Charles wrote: > Hello, > > Jo

Re: Version control best practices?

2010-03-05 Thread Bas van der Vlies
On 05-03-10 10:30, Tim Cutts wrote: > > On 5 Mar 2010, at 7:47 am, Bas van der Vlies wrote: > >> >> On Mar 5, 2010, at 12:52 AM, Jessica Greer wrote: >> >>> Thanks to everyone for the responses - that's helpful. Tim, I >>> especially like your idea of mailing out diffs, so everyone stays in >>> th

RE: Iterations for convergence : vars do not iterate

2010-03-05 Thread Lebel, Marco
I had the same issue with 3.0.2. I had to move my class declaration in a common bundle in order to make it work. Marco -Original Message- From: help-cfengine-boun...@cfengine.org [mailto:help-cfengine-boun...@cfengine.org] On Behalf Of lefollfr Sent: Friday, March 05, 2010 3:34 AM To:

Re: Iterations for convergence : vars do not iterate

2010-03-05 Thread lefollfr
Hello Marco, I tested with 3.0.3 and SVN revision 870. With classes defined somewhere earlier in the bundlesequence, i.e. already defined during first and single evaluation of a vars section, everything works fine indeed. But I think it breaks the "declarative" approach of promises, and requires a

RE: Iterations for convergence : vars do not iterate

2010-03-05 Thread Lebel, Marco
Frederic, All I was saying is that I did come across the same issue and I came up with a work around. That being said I am of your opinion that if a local class gets 'activated' at any point in time then the vars that are declare base on the existence of that class should become visible at tha

Re: Basic string replacement

2010-03-05 Thread Les Mikesell
daniel.kl...@cfengine.com wrote: > Because it is a declarative promise language - which is somewhat different > than the usual imperative programming language model. A fine point, but > different nontheless. Declarative languages are hard to get your head around > if you think in purely imperativ

Re: Basic string replacement

2010-03-05 Thread NWatson
CF does what it does and does it well whether it is programming language or not. It is definitely not like a scripting language and because of this I often find I have to alter my approach to promises. My mind tries to rely on its experience with shell and perl scripts but those methods don't

RE: Version control best practices?

2010-03-05 Thread Justin Lloyd
I'd like to throw out my own question about version control. I've finally finished my initial policy files for our pilot deploy (for the most part; need to update comments). There are four files that we currently maintain/edit: promises.cf, dg.config.cf, dg.library.cf, and dg.bundles.cf. The rest o

Re: How to run Cfengine 3 with Cfengine 2 policies? I get syntax errors.

2010-03-05 Thread Aleksey Tsalolikhin
Thanks, Nicolas. I understand Cfengine 3 CAN read Cfengine 2 policies - the feature is "Auto-encapsulation of Cfengine 2 for incremental upgrade", see at the bottom of http://cfengine.com/pages/cfengine3 I just want to find out HOW to do it. :) I am ready for an incremental upgrade of a product

RE: Version control best practices?

2010-03-05 Thread NWatson
I prefer to have the whole lot in version control. This makes it your go to place for disaster recovery or migration. Sometime you may want to use multiple repositories. /var/cfmasterfiles/config (general cfengine files) /var/cfmasterfiles/dns (hostmaster Bind files) /var/cfmasterfiles/app (a

Re: How to run Cfengine 3 with Cfengine 2 policies? I get syntax errors.

2010-03-05 Thread Mark Burgess
Aleksey, Cfengine 3 provides the possibility for cfengine 3 and cfengine 2 to coexist during an upgrade phase. It cannot *read* Cfengine 2 policies. Cfengine (the company) can help transform a configuration. Aleksey Tsalolikhin wrote: > Thanks, Nicolas. I understand Cfengine 3 CAN read Cfeng

cf3.0.4 released?

2010-03-05 Thread Matt Richards
Greetings, I see that cf-3.0.4 is out there, but access if forbidden to download it. I may have jumped the gun, but I am very excited. I haven't been to the cfengine web page lately, but, Wow! Lots of work and new stuff. Very impressive. Did ya happen to see Jarle Bjorgeengen's cfengine vs pup

Re: cf3.0.4 released?

2010-03-05 Thread Mark Burgess
Thanks Matt, sorry for the lapse. Matt Richards wrote: > Greetings, > > I see that cf-3.0.4 is out there, but access if forbidden to download it. I > may have jumped the gun, but I am very excited. > > I haven't been to the cfengine web page lately, but, Wow! Lots of work and > new stuff. Ver

Thoughts about copy_from

2010-03-05 Thread Justin Lloyd
I just wanted to throw out a couple of thoughts about copy_from that have come up in my mind during my policy development: * The reference manual doesn't specify the default value for copy_from's copy_backup attribute. (That goes for a number of things in the documentation, actually.) * cfengine_

Re: Thoughts about copy_from

2010-03-05 Thread Jesse Becker
On Fri, Mar 05, 2010 at 02:11:42PM -0500, Justin Lloyd wrote: >I just wanted to throw out a couple of thoughts about copy_from that >have come up in my mind during my policy development: Agreed on all three points. I'd like to add one more suggestion as well: * Include the ability to call expand

Re: Thoughts about copy_from

2010-03-05 Thread NWatson
help-cfengine-boun...@cfengine.org wrote on 2010-03-05 14:37:57: > I'd like to add one more suggestion as well: > > * Include the ability to call expand_scalars in the same promise as > copying a file from a remote host. Currently, this has to be done via > two separate promises: one to

Re: Thoughts about copy_from

2010-03-05 Thread Jesse Becker
On Fri, Mar 05, 2010 at 02:45:19PM -0500, nwat...@symcor.com wrote: >help-cfengine-boun...@cfengine.org wrote on 2010-03-05 14:37:57: >> I'd like to add one more suggestion as well: >> >> * Include the ability to call expand_scalars in the same promise as >> copying a file from a remote host.

RE: Thoughts about copy_from

2010-03-05 Thread Justin Lloyd
I think I understand Jesse's rationale but I agree with Neil. Analogously to the Unix command philosophy, IMHO, bodies (and often bundles) should do one thing and do it well. Use multiple promises in conjunction like you would use command-line pipes. Jesse, have you maybe tried something with a me

cfengine 3.0.4 first compile testing

2010-03-05 Thread NWatson
I can compile fine with no options but as soon as I get clever I break something: ./configure --prefix=/home/nwatson/cfengine --with-pcre=/home/nwatson/cfengine --with-berkeleydb=/home/nwatson/cfengine --without-sql --sbindir=/home/nwatson/cfengine/bin Configure looked good: checking for Berk

Re: Thoughts about copy_from

2010-03-05 Thread Jesse Becker
On Fri, Mar 05, 2010 at 03:07:36PM -0500, Justin Lloyd wrote: >I think I understand Jesse's rationale but I agree with Neil. >Analogously to the Unix command philosophy, IMHO, bodies (and often >bundles) should do one thing and do it well. Use multiple promises in >conjunction like you would use co

Re: Thoughts about copy_from

2010-03-05 Thread NWatson
Jesse, Perhaps you should take a fresh approach. Restate your original goal that started all your template efforts. Perhaps someone else has another way to do it. Sincerely, -- Neil Watson 416-673-3465 CONFIDENTIALITY WARNING This communication, including any attachments, is for the exclus

Is regextract in version 3.0.3?

2010-03-05 Thread Eric Black
Hi, I'm using community version 3.0.3 and I'm getting the following error: cf3:./test.cf:34,96: Unknown built-in function regextract(), near token ')' Is there another way of extracting values into strings with 3.0.3? I'm hoping I don't have to upgrade all the servers to 3.0.4 yet. This is wh

edit_line replace_with convergence issue

2010-03-05 Thread Justin Lloyd
According to the documentation, the following is not convergent: bundle agent ensure_pam_passwords_clear { files: "/etc/ldap.conf" edit_line => pam_password("clear"); } bundle edit_line pam_password(method) { replace_patterns: # haven't tested whether PCRE zero

RE: edit_line replace_with convergence issue

2010-03-05 Thread Justin Lloyd
Never mind, I solved my own problem. After I wrote it up and sent it, I started an email to my team about this issue, and it was then the solution dawned on me. To avoid the convergence issue, I just needed a class to restrict when the non-convergent replacement could happen by first reading the fi

Re: cfengine 3.0.4 first compile testing

2010-03-05 Thread Nakarin Phooripoom
It seems like the configure script could not find db header files. A good one should look like; checking for BerkeleyDB location in /var/cfengine.community... /var/cfengine.community checking Berkeley DB API... 4.8.24 OK checking for db_create in -ldb... yes You might need to do ldconfig or pos

RE: edit_line replace_with convergence issue

2010-03-05 Thread Justin Lloyd
Ok, take 3. It turns out, due to how Cfengine does changes in memory and compares that to the on-disk file, I don't even need to do the class check. Just comment all of the pam_password lines out and then do the uncomment_first_occurrence. The two replace_patterns promises together ARE convergent.

Re: How to run Cfengine 3 with Cfengine 2 policies? I get syntax errors.

2010-03-05 Thread Aleksey Tsalolikhin
Thanks, Mark. What is meant by "auto-encapsulation", please? Is it that I can I run cf-execd and cfexecd out of crontab and they'll happily share the /var/cfengine work directory? Thanks! Aleksey On Fri, Mar 5, 2010 at 10:34 AM, Mark Burgess wrote: > > Aleksey,  Cfengine 3 provides the possibi

Cfeninge Help (Mailing list): Re: Iterations for convergence : vars do not iterate

2010-03-05 Thread forum
Forum: Cfeninge Help (Mailing list) Subject: Re: Iterations for convergence : vars do not iterate Author: mark Link to topic: https://cfengine.com/forum/read.php?3,7774,7788#msg-7788 I suggest you report it as a bug on the bug tracker with a reproducible example of what you mean