[chef-dev] Re: Re: Re: Re: edit a file using chef


Chronological Thread 
  • From: Aaron Peterson < >
  • To: Adam Jacob < >
  • Cc: AJ Christensen < >, Bryan Berry < >, " " < >, " " < >
  • Subject: [chef-dev] Re: Re: Re: Re: edit a file using chef
  • Date: Fri, 15 Jun 2012 07:21:39 -0700

Lamont "I promise I'll only use it correctly, tactfully, and rarely"
Granquist, your argument does not persuade. :). But even if you held
true to that...

-1, I could never recommend this, and it fails most methodological
tests that Chef works under.

It should be trivial to take the whole file and templatize it. If you
cannot just easily take the whole file under management, that means
there is interestingly different content "out there" that represents
unmanaged yet important operational state. Now you are making
successive error-prone edits to a collection of interestingly
different files, and there is no guarantee that you will not have
drift unless you have already analyzed the differences across the
collection, at which point you might as well manage the whole thing.

Even if it is consistent, or the file differences are reproduced
normally by an underlying OS or software process, I had better only
add but never delete file edits to recipes, because if ever a machine
misses a past edit because it is off or whatever, or we launch a new
machine, we won't be creating the file correctly.

Generally, if you cannot always guarantee the recreation of the file
in its current state, you have entombed state and risk and have failed
to create an infrastructure you can reason about or rebuild.

Making it a full resource is the Chef imprimatur to use it, and this
isn't just rope, it's already tied into a noose and permanently
attached to a scaffold.  IMO.

-a

On Jun 14, 2012, at 14:02, Adam Jacob 
< >
 wrote:

> I wonder if it's time to finally turn that into a resource, even
> though I think there is near universal agreement it's not a great
> idea?
>
> Adam
>
> On Thu, Jun 14, 2012 at 4:54 AM, AJ Christensen 
> < >
>  wrote:
>https://github.com/opscode/chef/blob/master/chef/lib/chef/util/file_edit.rb
>>
>> On 14 June 2012 23:25, Bryan Berry 
>> < >
>>  wrote:
>>> minimin, u can use the template resource for this purpose
>>>
>>> questions like this are probably better suited to the main chef mailing 
>>> list
>>>
>>>
>>> On Thu, Jun 14, 2012 at 1:11 PM, 
>>> < >
>>>  wrote:
>>>>
>>>>
>>>> Hi,
>>>>
>>>> I saw a file resource which can be used to create and delete a file,but i
>>>> want
>>>> to edit a file with values provided by the user.
>>>> Does chef provides such facility??
>>>
>>>
>
>
>
> --
> Opscode, Inc.
> Adam Jacob, Chief Customer Officer
> T: (206) 619-7151 E: 
> 



Archive powered by MHonArc 2.6.16.

§