Re: CFEngine Help: Re: CFEngine Help: Re: [ANNOUNCE] CFEngine Community 3.4.0beta2 is released

2012-10-01 Thread Marco Marongiu
Hi all The discussion is turning out interesting. If anything, I am happy I helped spicing it up ;) On 01/10/12 23:07, no-re...@cfengine.com wrote: > Author: Authority > Link to topic: https://cfengine.com/forum/read.php?3,27604,27612#msg-27612 I always respect the authority, but that doesn't s

Re: CFEngine Help: Re: [ANNOUNCE] CFEngine Community 3.4.0beta2 is released

2012-10-01 Thread Marco Marongiu
> Where did this come from? We already handle this using classes. Why > add another method to muddy the waters? Changing a feature's main > purpose from documentation to functional leaves me dumbfounded. [...] > We can already reorder promises using classes. What purpose is > served by adding an

Re: CFEngine Help: Re: Aborting CFEngine agent if there is an earlier instance of it already running

2012-09-09 Thread Marco Marongiu
On 07/09/12 13:11, no-re...@cfengine.com wrote: > Look at expireafter in agent control. Hi Neil, all I see in the reference that expireafter has a default value of 1 minute "for time before on-going promise repairs are interrupted". If it was effective in Aleksey, he would never have the problem

Re: Aborting CFEngine agent if there is an earlier instance of it already running

2012-09-07 Thread Marco Marongiu
Hi Aleksey I haven't been burnt by this (yet) so you may want to take this with reservation :) I'd go for a double approach here. As you say, I'd count root's instances of cf-agent and use abortclasses to give up if the count is higher than 1. To be more effective, this check should happen as ear

Re: CFEngine Help: CFEngine job post

2012-08-30 Thread Marco Marongiu
> We are looking for a full-time CFEngine engineer in New York: > http://percolate.com/jobs#devops > Anybody knows a good place to find CFEngine lovers on the net? The CFEngine group in LinkedIn maybe? http://www.linkedin.com/groups?home=&gid=136574&trk=anet_ug_hm Of course, it has a "Jobs" secti

Re: Forcing variable evaluation after file promises

2012-08-15 Thread Marco Marongiu
On 15/08/12 12:26, Mike Brodbelt wrote: > I would like to have a variable assignment happen after the execution > of one file promise, before a second one happens. Add a classes => ... clause to your files promises, e.g.: "filename" classes => always("filename_promise_executed"), ... other cl

Re: CFEngine Help: Re: IPv4 addresses for tun0 not showing?

2012-07-21 Thread Marco Marongiu
On 20/07/12 07:54, no-re...@cfengine.com wrote: > Marco, this looks like a bug - would you mind reporting it on > http://cfengine.com/bugtracker/ ? Filed: https://cfengine.com/bugtracker/view.php?id=1246 Ciao -- bronto ___ Help-cfengine mailing list Hel

Re: IPv4 addresses for tun0 not showing?

2012-07-19 Thread Marco Marongiu
Anyone? Should I go for a module? Thanks -- M On 29/06/12 22:29, Marco Marongiu wrote: > Hi > > I was writing a policy to do some fixups on my laptop when I'm on the > VPN, but weird things were happening. After narrowing down the problem > with a test policy, it seems t

IPv4 addresses for tun0 not showing?

2012-06-29 Thread Marco Marongiu
Hi I was writing a policy to do some fixups on my laptop when I'm on the VPN, but weird things were happening. After narrowing down the problem with a test policy, it seems that cfengine doesn't read the IPv4 address of the tun0 device. Maybe a bug? If I list the ip addresses on the machine, I ge

Re: feature proposal for cfengine.el

2012-06-29 Thread Marco Marongiu
On 26/06/12 15:14, Ted Zlatanov wrote: > Yup, that's exactly what skeleton.el does. Could you give me some > templates you'd use and tell me what portions should be parameterized? > I'll do the rest. Here. As simple as they are, and the only parameter would be the bundle name. I'd probably use ag

Re: array of lists expansion

2012-06-25 Thread Marco Marongiu
Apologies, I spotted a few mistakes here: > I am preparing a policy to create authorized_keys files on a set of > server. read "servers" > Depending on which classes a server is in, it must get a > different set of keys in its authorized_keys file. I organized my stuff > this way: > > I have an

Re: array of lists expansion

2012-06-25 Thread Marco Marongiu
On 25/06/12 19:56, Nick Anderson wrote: > On 06/25/2012 12:50 PM, Marco Marongiu wrote: >> Summing up, the right way to expand a slist contained in an array >> element is actually: >> >> "list" slist => { "@(array[$(selector)])" } ; >>

Re: array of lists expansion

2012-06-25 Thread Marco Marongiu
Thanks Nick I actually discovered that there was a dumb, but it was not the question: it was me :) Due to a well hidden bug in my code, the list expansion appeared not to be working. It took me some time, some runs of cf-agent -v, and an incremental set of changes in a bundle, to discover that th

array of lists expansion

2012-06-25 Thread Marco Marongiu
Hi all OK, I admit this must be *dumb*, but I cannot get out of this... Suppose I have an array of lists: "array[key1]" slist => { ... } ; "array[key2]" slist => { ... } ; . . . "array[keyN]" slist => { ... } ; and suppose that $(selector) contains one of the keys. Given that, I'd like to expa

Re: feature proposal for cfengine.el

2012-06-23 Thread Marco Marongiu
On 22/06/12 20:05, Ted Zlatanov wrote: > Marco and others, do you want to suggest some good blank templates for > the various bundles and bodies? I'll take care of integrating them with > cfengine-mode.el. They'll be in the menus somewhere. Personally, I'd be content with a plain template for al

feature proposal for cfengine.el

2012-06-15 Thread Marco Marongiu
Hi all Ted: yes, this is for you :) I found that having the promises laid out in normal order in the bundles can help a lot in understanding how things actually go on when the policy is run. It would be nice if we had a key combination that, once pressed, detects the bundle the cursor is in, and

Re: CFEngine Help: Re: cf-runagent and keys

2012-06-15 Thread Marco Marongiu
On 15/06/12 16:32, Neil Watson wrote: >> It's set to true, in fact. One clarification though: are you suggesting >> >to remove/comment out the directive, or to set it to false? > Remove/comment it. OK, thanks. I'll test it immediately! >> >When I'll put these policies in production, they'll have

Re: CFEngine Help: Re: cf-runagent and keys

2012-06-15 Thread Marco Marongiu
On 15/06/12 16:20, Neil Watson wrote: > This is slightly similar to a bug I saw when using IPV6. The trouble > for me was skipidentify. If you have skipidentify => "true"; somewhere > in your policy try removing it. It's set to true, in fact. One clarification though: are you suggesting to remov

Re: CFEngine Help: Re: cf-runagent and keys

2012-06-15 Thread Marco Marongiu
On 14/06/12 20:23, no-re...@cfengine.com wrote: > Marco, could you post the verbose output of cf-runagent, maybe we can > get a clue what's going on from there. That happened again, finally, and examining the output I found at least one strangeness. The file in attachment is a copy & paste from a

Re: Hierarchy of policy hubs

2012-06-15 Thread Marco Marongiu
Thanks all for your precious advice. I'll definitely keep it into account! Ciao -- bronto ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine

cf-runagent and keys

2012-06-14 Thread Marco Marongiu
Hi all I have a strange problem with cf-runagent. I am pretty sure that it's my fault but I can't see what I am doing wrong. I want to be able to run cf-runagent on the policy host and request clients to perform certain actions (either run cf-agent, plain, or run it with certain classes defined,

Hierarchy of policy hubs

2012-06-14 Thread Marco Marongiu
Hi there Is there any document available that explains what one should do in practice to create a hierarchy of policy hubs? I tried to google for it on cfengine.com but couldn't find any. I am using the community edition. Thanks -- bronto ___ Help-cfeng

Re: CFEngine Help: Re: readstringarray stopped working

2012-06-04 Thread Marco Marongiu
On 04/06/2012 09:50, no-re...@cfengine.com wrote: > If it's that same bug, try the workarounds I listed in the bug > report: either hardcode the filename, or put an intermediate bundle > in between. Pass the name as a variable to the interim bundle and let > the interim bundle call your final bundl

Re: CFEngine Help: Re: readstringarray stopped working

2012-06-03 Thread Marco Marongiu
On 01/06/12 18:40, Marco Marongiu wrote: > FYI, I tried to move the readstringarray call up and up in the stack, > and it didn't work properly (i.e.: set $(records) as it should) until I > put it the top, non-parametric bundle (bundle agent test). Could it be bug 887? https:

Re: CFEngine Help: Regular expression error "nothing to repeat"

2012-06-01 Thread Marco Marongiu
Hi David > So it seems that the field edits are seeing the content of the > selector as a regex? I think so, too. Yes. > Is there a way to escape this somehow? Yes: the escape() function. Please try that, and let us know if it fixes the problem. Thanks Ciao -- bronto

Re: CFEngine Help: Re: readstringarray stopped working

2012-06-01 Thread Marco Marongiu
On 01/06/2012 17:37, Marco Marongiu wrote: > What I really fail to understand is why the readstringarray function > doesn't fill out $(records) any more when I make the bundles > parametric. Can you reproduce that? Is it a because of a stupid > mistake on my side? FYI, I

Re: CFEngine Help: Re: readstringarray stopped working

2012-06-01 Thread Marco Marongiu
On 31/05/2012 20:48, no-re...@cfengine.com wrote: > Marco, please look at my reply to your original message (which > admittedly, I just posted, although I thought I had posted it way > back then): > https://cfengine.com/forum/read.php?3,26058,26098#msg-26098 :-D > I haven't looked at your new bu

Re: CFEngine Help: Re: Matching a "parametric" regex

2012-06-01 Thread Marco Marongiu
Hi Diego, thanks for answering As you've seen, my final policy does much more than that, so I'll follow up with this conversation in the other thread. Ciao -- bronto ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/

readstringarray stopped working

2012-05-31 Thread Marco Marongiu
Hi all I didn't get much consideration with my latest messages, but I will try again :-D As said on May 24th, I am trying to manage /etc/hosts in a decent way, adding records that should be there but aren't, or removing some which are there but shouldn't. After a lot of trial and error, and some

Matching a "parametric" regex

2012-05-24 Thread Marco Marongiu
Hi all I am trying to check for some records in the /etc/hosts file. More specifically, I want that: 1) There must be only one line matching "^$(sys.ipv4)\s+$(fqhost)\s+$(uqhost)\b.*$" I don't care if other names are added after the two canonical ones, in that order. 2) If there are other lines

Re: templates: regression in 3.3.x?

2012-05-24 Thread Marco Marongiu
On 23/05/2012 14:14, Marco Marongiu wrote: > duplicated lines in templates must *not* be suppressed. re-read the docs: it looks like I need to use BEGIN/END blocks for that. I overlooked it since it seemed to be related to list expansion only. I'll check if it does what I mea

Re: templates: regression in 3.3.x?

2012-05-23 Thread Marco Marongiu
On 23/05/2012 14:14, Marco Marongiu wrote: > I partially found the source for the "regression": I used > expand_template in previous versions. I'll check that Checked: If the file exists the way it was created by edit_template, it won't be changed unless you add &quo

Re: templates: regression in 3.3.x?

2012-05-23 Thread Marco Marongiu
> Can you confirm this is a regression from pre-3.3 versions? I partially found the source for the "regression": I used expand_template in previous versions. I'll check that However, I keep the point for how templates should behave: duplicated lines in templates must *not* be suppressed. Just thi

templates: regression in 3.3.x?

2012-05-23 Thread Marco Marongiu
Hi all I have a simple template like the following: ---8<--8<--8<--8<--8<--8<--8<--8<--8<--- ### # # snmdp configuration for host $(sys.fqhost) # # This file is centrally managed by cfengine # Locatio

classes in packages promises

2012-05-23 Thread Marco Marongiu
Hi all I'd expect this promise to define the class snmpd_installed: - if the package was not installed, and it succeeds in installing it; - if the package is already installed. packages: "snmpd" comment=> "Install snmpd", package_policy => "addupdate", p

Re: Rare/exotic operating systems support

2012-05-21 Thread Marco Marongiu
Hi Mikhail On 21/05/2012 15:28, Mikhail Gusarov wrote: > I'd like to know is there anyone who uses CFEngine 3 on the following > operating > systems: > > - SCO OpenServer > - SCO UnixWare > - QNX > - Cray/UNICOS > > Those systems will be dropped in 3.4.0 unless there are active users. > An h

Re: CFEngine Help: make a string from a list

2012-05-18 Thread Marco Marongiu
On 18/05/2012 09:56, no-re...@cfengine.com wrote: > Is their a way to do this? Take a look at the join function: https://cfengine.com/manuals/cf3-reference#Function-join Ciao! -- bronto ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://

Re: CFEngine Help: Usernames starting with numbers misinterpreted as UID

2012-05-02 Thread Marco Marongiu
Il 01/05/2012 15:17, no-re...@cfengine.com ha scritto: > Usernames which start with numbers are misinterpreted as UID's. This > seems to be the case in all places where CFEngine takes a username or > UID, i.e. (mog, perms, etc...) for cfengine-community-3.2.1-1.el5 As far as I remember, a UNIX use

Re: classes not working in vars?

2012-03-16 Thread Marco Marongiu
Il 16/03/2012 15:58, Brian Bennett ha scritto: > Are you trying to set a class if a vars promise has been kept, or set > a variable based on the existence of a class? Actually both :) $(shortname) is set to $(names), if a $(names) class is defined. What I desired was that, once $(shortname) is s

Re: classes not working in vars?

2012-03-16 Thread Marco Marongiu
Il 16/03/2012 15:42, Nick Anderson ha scritto: >> > Your approach is not exactly equivalent to having a classes attribute in >> > vars, but I made it do ;) > What is so different about it? The difference is that with a classes attribute, the class is set immediately, and would affect subsequent pr

Re: classes not working in vars?

2012-03-16 Thread Marco Marongiu
Il 16/03/2012 15:16, Nick Anderson ha scritto: >>> classes: >>> >> "has_shortname" >>> >> expression => isvariable("shortname"), >>> >> comment => "Set a class if short hostname has been defined"; >> > >> > Nice hint, thanks, I'll use it :) > I am kind of surprised that having classes

Re: classes not working in vars?

2012-03-16 Thread Marco Marongiu
Il 16/03/2012 14:26, Nick Anderson ha scritto: > classes: > "has_shortname" > expression => isvariable("shortname"), > comment => "Set a class if short hostname has been defined"; Nice hint, thanks, I'll use it :) ciao -- bronto ___ Help-cfe

classes not working in vars?

2012-03-16 Thread Marco Marongiu
Hi Hi had this vars: promise not working as expected: "shortname" comment=> "set a short name if $(names) is defined", classes=> always("has_shortname"), string => "$(names)", ifvarclass => "$(names)" ; shortname got its value after $(nam

Re: CFEngine Help: Re: The right order

2012-02-29 Thread Marco Marongiu
Il 29/02/2012 18:31, no-re...@cfengine.com ha scritto: > First of all, *aw shucks* thanks for the very nice words about the > book in your post :) My pleasure, that's much deserved! > Second, I would agree with everything that Mark said, and encourage > you to look at the new edit_template attri

Re: The right order

2012-02-29 Thread Marco Marongiu
Hi Mark, all Il 29/02/2012 14:45, Mark Burgess ha scritto: > there is nothing wrong with what you did, but it is probably a lot > more complicated than you need to make it. ...which is good news :) > I think you need to ask yourself a > question: > > 1. What is the use-case for having things i

Re: CFEngine Help: New Book on Cfengine

2012-02-08 Thread Marco Marongiu
Il 08/02/2012 14:13, Marco Marongiu ha scritto: > Il 08/12/2011 14:36, no-re...@cfengine.com ha scritto: >> Indeed the Early Release is out, it includes the first four >> chapters of the book, which are: Introduction, Getting Started with >> CFEngine, CFEngine Basics and U

Re: CFEngine Help: New Book on Cfengine

2012-02-08 Thread Marco Marongiu
Il 08/12/2011 14:36, no-re...@cfengine.com ha scritto: > Indeed the Early Release is out, it includes the first four chapters > of the book, which are: Introduction, Getting Started with CFEngine, > CFEngine Basics and Using CFEngine. I read chapters 3 and 4: congratulations. This is the tutorial

Re: CFEngine Help: !!! System error for fclose: "No space left on device"

2012-01-13 Thread Marco Marongiu
Il 12/01/2012 23:44, Jerome Yanga ha scritto: > It seems like cf_Audit.tcdb is taking all the space. How do I clear > this audit log? With "> cf_Audit.tcdb", on UNIX systems and bourne-like shells. I don't know which consequences this would have on cfengine, though. I expect none, but... do it at

Re: CFEngine Help: Thoughts about some cfengine design decisions?

2011-12-16 Thread Marco Marongiu
Il 15/12/2011 21:04, Jesse Becker ha scritto: >> 3) Maybe connected to the previous problem: the language itself is too >> complicated for beginners. It would be nice to have sort of a simplified >> language (cfScript?), and a compiler to translate it into cfengine3 >> native policies. > > I'm not

Re: CFEngine Help: Thoughts about some cfengine design decisions?

2011-12-14 Thread Marco Marongiu
On 14/12/11 11:30, Mark Burgess wrote: > Thanks for good feedback. Can you elaborate at all on what topics you > would like to see in a better tutorial? I can try. The current tutorial talks a lot about a lot of things, but concrete examples don't have even a single, full section. A few trivial

Re: CFEngine Help: Thoughts about some cfengine design decisions?

2011-12-14 Thread Marco Marongiu
Hi I can't be as specific as lauwersw. I've been a cfengine2 user for some time, but my experience with cfengine3 is still too small. 1) So, on a general note, and resuming what I already said in other threads, simple file editing is sometimes too hard. E.g.: placing pieces of text in a very well

Re: CFEngine Help: Re: CFEngine Help: Re: CFEngine Help: New Book on Cfengine

2011-12-12 Thread Marco Marongiu
Il 12/12/2011 20:25, no-re...@cfengine.com ha scritto: > Just FYI, as of today at least, the "AUTHD" code worked for the > ebook. (Previously it looked like it worked for the print edition, > but not the e-book.) I reported it last Friday, when I successfully bought it. Did my email arrive? I had

Re: CFEngine Help: Re: downsizing a huge policy file, sensibly

2011-12-09 Thread Marco Marongiu
Il 05/12/2011 16:33, Marco Marongiu ha scritto: > Let's see what I can turn up with with your suggestions. OK, I seem to have made it. It was hard, damn how it was. We should really meditate on this. Having a common block of reusable code should be far easier than this... Here's a s

Re: CFEngine Help: Re: CFEngine Help: New Book on Cfengine

2011-12-09 Thread Marco Marongiu
Il 08/12/2011 14:36, no-re...@cfengine.com ha scritto: > The code is AUTHD, and it gives you 50% off the ebook version, and > 40% off the print version. Book available and bought :) Thanks Ciao -- bronto ___ Help-cfengine mailing list Help-cfengine@cfen

Re: CFEngine Help: Re: CFEngine Help: New Book on Cfengine

2011-12-08 Thread Marco Marongiu
Il 08/12/2011 14:36, no-re...@cfengine.com ha scritto: > The code is AUTHD No luck with this one, too: "You did not meet the criteria for this discount.". As O'Reilly support said, I'll wait for a few days and try again. Ciao -- bronto ___ Help-cfengin

Re: CFEngine Help: Re: CFEngine Help: New Book on Cfengine

2011-12-08 Thread Marco Marongiu
Il 08/12/2011 14:36, no-re...@cfengine.com ha scritto: > Thank you Marco for the mention. My pleasure :) > Indeed the Early Release is out, it > includes the first four chapters of the book, which are: > Introduction, Getting Started with CFEngine, CFEngine Basics and > Using CFEngine. Uh, fro

Re: CFEngine Help: New Book on Cfengine

2011-12-08 Thread Marco Marongiu
Hi! Il 07/12/2011 19:34, no-re...@cfengine.com ha scritto: > Packt Publishing has come out with a new book entitled "CFEngine 3 > Beginner's Guide". It is a step-by-step guide to setting up Cfengine > and fully automating the configuration and management of your laptop, > desktop, server, or main

Re: cannot use cfengine3 mode in Emacs 23

2011-12-07 Thread Marco Marongiu
Hi Ted Excellent job :) I will try it today. Il 07/12/2011 12:22, Ted Zlatanov ha scritto: > Please try it and let me know how you like it. I may change the > default if enough people like another style. Personally, I am a fan of something like: > The default is to anchor at promise, indent pa

Re: CFEngine Help: Re: downsizing a huge policy file, sensibly

2011-12-05 Thread Marco Marongiu
Thanks for all the answers. I was supposed to work on this today, but I haven't started yet due to a runaway meeting :-D Let's see what I can turn up with with your suggestions. Thanks a lot again -- bronto ___ Help-cfengine mailing list Help-cfengine

Re: cannot use cfengine3 mode in Emacs 23

2011-12-01 Thread Marco Marongiu
Il 01/12/2011 16:22, Ted Zlatanov ha scritto: > I tested with 23.1 on Mac OS X (from http://emacsformacosx.com/builds). > It definitely knows about `font-lock-constant-name-face' so your error > is very suspicious. > > I also tested highlighting and indentation. It works fine. It could be > some

Re: CFEngine Help: An advanced policy using template and variable substitution

2011-11-30 Thread Marco Marongiu
Il 30/11/2011 09:14, Bas van der Vlies ha scritto: > PS) I still need to go to the web interface to read this message. Is > there a fix. So i can read posts with arrays with an email program? +1, very, very annoying (and I'd burn *all* the forums that require me to visit them periodically to see

Re: CFEngine Help: Re: downsizing a huge policy file, sensibly

2011-11-29 Thread Marco Marongiu
Hi David I tried to work out something based on your advice, but it seems I can't make it work. My idea was: - load a policy file called ntp.cf, always, and a location specific one, say ntp_x.cf for location x; - in ntp_x.cf, define an array which will hold values depending on the machine being

Re: cannot use cfengine3 mode in Emacs 23

2011-11-29 Thread Marco Marongiu
Il 28/11/2011 17:24, Marco Marongiu ha scritto: > As I load the mode using M-x cfengine3-mode, the font highlighting is a > bit crapped, and I get this message: > > Error during redisplay: (void-variable font-lock-constant-name-face) [4 > times] Add: indentation refers to curly

Re: cannot use cfengine3 mode in Emacs 23

2011-11-28 Thread Marco Marongiu
Il 28/11/2011 17:21, Marco Marongiu ha scritto: > Hi Ted & all > > Il 27/11/2011 04:02, Ted Zlatanov ha scritto: >> Fixed version attached. Tested with Emacs 23.2 > > I've just done a quick test, and things seem to work smoothly Forget that :( As I load the mode

Re: cannot use cfengine3 mode in Emacs 23

2011-11-28 Thread Marco Marongiu
Hi Ted & all Il 27/11/2011 04:02, Ted Zlatanov ha scritto: > Fixed version attached. Tested with Emacs 23.2 I've just done a quick test, and things seem to work smoothly (GNU Emacs 23.1.1 running on Ubuntu Linux 10.04 LTS) Tomorrow I'll spend much more time on cfengine than today, if I spot any

downsizing a huge policy file, sensibly

2011-11-23 Thread Marco Marongiu
Hi all My ntp.cf has grown to nearly 800 lines now. Location-dependent setting are the biggest part of it, while a smaller part (files, processes, reports, and commands promises) is common for all locations. I'd like to reduce its size to something more manageable. I was considering to write a mo

Re: cannot use cfengine3 mode in Emacs 23

2011-11-23 Thread Marco Marongiu
Hi Ted Il 23/11/2011 00:43, Ted Zlatanov ha scritto: > Please try the attached patch and tell me if it works for you. It > should, it's a one-line change. I'll put the change into the cfengine > and Emacs trunks if it works OK. FOA, Thanks a lot! The patch doesn't apply, as this line: > (def

Re: Why I can't match a running process?

2011-11-21 Thread Marco Marongiu
Solved: I could actually promise "ntpd" more than once. -- M ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine

Why I can't match a running process?

2011-11-21 Thread Marco Marongiu
Hi all I am having problem at selecting processes. The plan of action is: - count how many ntpd seem to be running - if zero, then start ntpd - if more than one, kill all processes matching ntpd, then start ntpd again I didn't find a way to use just one promise to express this, so I tried wit

Re: CFEngine Help: Re: cf-agent run time limit (hanging during package installation)

2011-11-18 Thread Marco Marongiu
I also see that you should set two more environment variables (promises.cf is a good place for that): APT_LISTBUGS_FRONTEND="none" APT_LISTCHANGES_FRONTEND="none" Again, it's better you don't know where I got this information from :) Ciao -- bronto ___

Re: cannot use cfengine3 mode in Emacs 23

2011-11-17 Thread Marco Marongiu
Il 17/11/2011 15:45, Ted Zlatanov ha scritto: > this is because I only tested against Emacs 24, I didn't know prog-mode > was not available in earlier ones. I will make the necessary changes. Thanks a lot!!! Ciao -- bronto ___ Help-cfengine mailing li

Re: CFEngine Help: Re: cf-agent run time limit (hanging during package installation)

2011-11-17 Thread Marco Marongiu
Il 17/11/2011 17:35, no-re...@cfengine.com ha scritto: > That assumes you want to keep the old configuration file rather than > the new one (--force-confew). See dpkg man file under > --force-things. It does, because I assume that the configuration is taken care of by cfengine. Of course I could

Re: CFEngine Help: Re: cf-agent run time limit (hanging during package installation)

2011-11-17 Thread Marco Marongiu
This works: > body package_method aptget > { > package_changes => "bulk"; > package_list_command => "/usr/bin/dpkg -l"; > package_list_name_regex=> "ii\s+([^\s]+).*"; > package_list_version_regex => "ii\s+[^\s]+\s+([^\s]+).*"; > package_installed_regex => ".*"; # all reported are installed >

Re: CFEngine Help: Re: cf-agent run time limit (hanging during package installation)

2011-11-17 Thread Marco Marongiu
Il 17/11/2011 16:55, Mark Burgess ha scritto: > You can try this and report on that bug tracker > whether it works for you...? it doesn't. I guess the variable setting with env is not exported by apt-get to the dpkg subprocess. It is still hanging on user input. For the record, this is how my bu

Re: CFEngine Help: Re: cf-agent run time limit (hanging during package installation)

2011-11-17 Thread Marco Marongiu
Il 17/11/2011 16:35, Mark Burgess ha scritto: > body agent control > { > environment => { "DEBIAN_FRONTEND=noninteractive", "LANG=C" }; > } As said, neither expireafter nor this is working for me, and I seem to be not the only one having this kind of trouble: https://cfengine.com/bugtracker/view

Re: CFEngine Help: Re: cf-agent run time limit (hanging during package installation)

2011-11-17 Thread Marco Marongiu
Il 17/11/2011 16:32, Nick Anderson ha scritto: > You probably need something like this. > > body agent control { > # This is needed for packages that want some configuration like > # postfix. > environment => { "DEBIAN_FRONTEND=noninteractive" }; > } > > It's there already: debian

Re: CFEngine Help: Re: cf-agent run time limit (hanging during package installation)

2011-11-17 Thread Marco Marongiu
Il 17/11/2011 16:22, no-re...@cfengine.com ha scritto: > Run your promise in verbose mode and see what Cf is telling apt or > aptitude to do. Package promises are very tricky and Cfengine is not > really to blame. Many package managers do not behave as expected. I'm already doing that. aptitude,

Re: CFEngine Help: Re: cf-agent run time limit (hanging during package installation)

2011-11-17 Thread Marco Marongiu
Il 17/11/2011 16:05, Mark Burgess ha scritto: > If you have an interactive program waiting for input, then CFEngine's > batch approach is not really compatible. You probably need to run > the programs in non-interactive mode, and maybe close any input > channels < /dev/null. Wait... so we are acc

Re: CFEngine Help: Re: cf-agent run time limit (hanging during package installation)

2011-11-17 Thread Marco Marongiu
Il 17/11/2011 15:25, Marco Marongiu ha scritto: > Oh, thanks so much Neil!!! > > I've looked for "hang", "abort" and all possible synonyms, but of course > I missed on "expire" :( Unfortunately, it doesn't work :( I altered the "body a

Re: CFEngine Help: Re: cf-agent run time limit (hanging during package installation)

2011-11-17 Thread Marco Marongiu
Il 17/11/2011 15:17, no-re...@cfengine.com ha scritto: > http://cfengine.com/manuals/cf3-reference.html#expireafter-in-agent > > There is a body in COPBL already. Oh, thanks so much Neil!!! I've looked for "hang", "abort" and all possible synonyms, but of course I missed on "expire" :( Ciao --

cf-agent run time limit (hanging during package installation)

2011-11-17 Thread Marco Marongiu
Hi all A policy file of mine is supposed to configure ntp on the systems. Unfortunately, aptitude/dpkg hang requiring keyboard input, and cf-agent hangs on them. I've been searching for a way to timeout cf-agent on package installations, with no luck. But I am sure there *must* be a way... Any s

Re: CFEngine Help: Re: "real" templates

2011-11-11 Thread Marco Marongiu
Il 11/11/2011 11:40, no-re...@cfengine.com ha scritto: > I apologise for coming very late to this discussion. I have made some > examples of templating in the Special Topics Guide on file editing. > Please read this section > > http://www.cfengine.com/manuals/st-editing.html#File-templates Thanks

Re: CPU-leakage in cf-serverd?

2011-11-11 Thread Marco Marongiu
Il 09/11/2011 15:45, Marco Marongiu ha scritto: > According to strace, what happens is that every 14 seconds cf-serverd > opens /dev/null with FD#5 and starts throwing html code on it. The peak > load on the CPU for cf-serverd is around 20% with a freshly started > instance, and go

CPU-leakage in cf-serverd?

2011-11-09 Thread Marco Marongiu
Hi all I found that cf-serverd is wasting a lot of CPU doing nothing useful in both 3.2.1 and 3.2.3 community edition. The OS is Debian Linux "Squeeze" running on a VirtualBox VM on my workstation. I am using the masterfiles provided with the distribution, with some changes. But no changes have b

Different versions of standard library in 3.2.3

2011-11-08 Thread Marco Marongiu
Hi all I've just compiled 3.2.3 from sources and noticed that there are two different versions of cfengine_stdlib.cf in the package. Under share/cfengine/masterfiles/ we have Rev. 84 Under share/doc/cfengine/examples/ we have Rev. 95 Any good reason for that? Since I started with the masterfile

Re: CFEngine Help: Re: "real" templates

2011-11-04 Thread Marco Marongiu
Hi Il 03/11/2011 10:44, no-re...@cfengine.com ha scritto: > I don't exactly see what kind of help you need, Yes, sorry. The thread started with templates, and it ended with a thread on file editing in general. Besides, I was not able to show any code so far because of too much "internal" informat

Re: CFEngine Help: Re: CFEngine Help: Re: "real" templates

2011-11-02 Thread Marco Marongiu
Il 01/11/2011 17:13, no-re...@cfengine.com ha scritto: > It sounds like your rules boil down to: > "insert this multi-line header at the top" > "insert several lines based on conditions which could be defined as > classes" More or less, yes. See below. > you basically have just a few classes nee

Re: CFEngine Help: Re: "real" templates

2011-11-02 Thread Marco Marongiu
Hi all Il 30/10/2011 20:42, no-re...@cfengine.com ha scritto: > "server_list" slist => { "server1", "server2", "server3" }; > "temporary_string" > string => join(" iburst$(const.endl)server ","server_list"); > "optional2" string => "server $(temporary_string) iburst"; [...] > st

Re: CFEngine Help: Re: "real" templates

2011-10-29 Thread Marco Marongiu
Il 29/10/2011 17:30, no-re...@cfengine.com ha scritto: > Well, if we are talking edit files, We do, sorry if it wasn't evident. I thought it was clear when mentioning templates and conditionally adding stuff to a file. Let me break down the problem, so that it will be easier to understand why I a

Re: CFEngine Help: Re: "real" templates

2011-10-29 Thread Marco Marongiu
Il 29/10/2011 17:09, no-re...@cfengine.com ha scritto: > I'm not certain of the parent's intent but I do wish expand_scalars > supported lists in a looping fashion. For example if I have a list of > ntp 'servers' bound for ntp.conf I have to preform a little trickery > to merge the list into a mult

"real" templates

2011-10-29 Thread Marco Marongiu
Hello there I would like to know if there is any real templating system that can be used in cfengine3, and that is not limited to simple scalar substitution. I am talking about templates supporting conditionals, like if ($this) { add that to the file } or array expansion, like foreach $server (