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


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

This exchange (Aaron and Lamont) is almost exactly the conversation
Adam and I had when I first had Nuo write file_edit and that's why we
decided to bury it.  It's useful, but cuts against the grain.
Pragmatically though, there are files over which you may not have full
control.  We constantly tell people that you can ease into as much
Chef as you can take, without having to rigidly accept our model.
Doesn't saying "but you can only manage whole files, rendered by Chef"
blunt that argument?

-C

On Fri, Jun 15, 2012 at 7:21 AM, Aaron Peterson 
< >
 wrote:
> 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: 
>



-- 
Christopher Brown, Chief Technical Officer, Opscode, Inc.
T: (425) 502-5522, E: 

IRC, Github: skeptomai
Twitter: @skeptomai



Archive powered by MHonArc 2.6.16.

§