help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need 'UncommentAndSetValue' or some such


From: Paul Krizak
Subject: Re: Need 'UncommentAndSetValue' or some such
Date: Thu, 27 Oct 2005 14:38:34 -0500
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050728)

I definitely see where you're coming from. I like the idea of treating things like this as objects as well, but I think it would introduce a whole new kind of complexity to have cfengine "know" how to deal with various types of config files. Besides that, what if you want to configure a service that cfengine hasn't been told how to manage? Then you're right back at square one, trying to use editfiles to maintain the file.

I've found that the facilities provided by editfiles are a fine way of maintaining our config files. I think it's a *good* thing that more features get added to it, because there is nothing more generic than the ability to edit a text file. There is nothing generic about cfengine having compiled-in knowledge about what a "hosts" file looks like, or what a "crontab" should look like.

Paul Krizak                         5900 E. Ben White Blvd. MS 625
Advanced Micro Devices              Austin, Tx  78741
Linux/Unix Systems Engineering      Phone: (512) 602-8775
Microprocessor Solutions Sector


Luke Kanies wrote:
On Thu, 27 Oct 2005, Paul Krizak wrote:


I find option #4 silly...cfengine should most certainly be able to edit
config files...that's what it's for!  But that's just my opinion.


I'll take point with this, since I'm squarely in the "editfiles is evil"
camp.

Cfengine has a clear, mature ability to manage files as a whole (using
copy) and file metadata (i.e., owner, mode, etc.).  I don't agree at all
that cfengine is "for" editing file contents directly, though, and I have
seen very little evidence that that is the case.  Yes, people use editfiles,
but what else can they use to manage portions of the contents of files?
Cfengine has no other mechanisms.

Both as a consultant and as a sysadmin, I relied on editfiles for only the
simplest of jobs, and I usually regretted those.  Instead I pretty much
always wrote external modules that allowed me to address the contents of
files objectively.  I have modules for managing /etc/services (no, I will
not append a 5308 line, thank you), /etc/inetd.conf, cron tabs, and much
else, and I just mention the object names in my cfengine configuration
(e.g., I set up a "rootcrons" variable with things like "logrotate cfengine"
as the contents, this variable gets passed to a module, and the module
creates the cron tab).

I think editfiles should be essentially replaced with a system that allows
people to manage objects contained in files (hosts in /etc/hosts, services
in /etc/services, filesystems in /etc/fstab, cron jobs in
/var/spool/crontabs/*) as objects, not as lines in a file.  The reason
editfiles is so complicated is because it's the wrong approach for complete
management.

I'll allow that it's a good idea to keep a simplistic editfiles around, but
I say cut out 90% of its functionality and put in something that treats most
files the way we think of them -- collections of objects -- not the way the
computer "thinks" of them.

I'm guessing that 90% of all cfengine code out there is devoted to host
grouping, file actions (files, tidy, etc.), shellcommands, and triggering
processes based on changes.  Throw in modules, and you're asymptotic.



David Scott Coburn wrote:

4) Those who think that letting cfengine edit config files is "evil".
  (No criticism of this view intended.)








reply via email to

[Prev in Thread] Current Thread [Next in Thread]