[chef-dev] Re: Re: Re: Re: Re: local file copy resource?


Chronological Thread 
  • From: Zac Stevens < >
  • To: Daniel DeLeo < >
  • Cc: Jesse Campbell < >, Chef Dev < >
  • Subject: [chef-dev] Re: Re: Re: Re: Re: local file copy resource?
  • Date: Wed, 12 Dec 2012 18:03:20 +0000

Jesse - thankyou for working on this.  Whatever form the solution takes, I'm sure I'll use it.

I wanted to add my 2 cents...

On Wed, Dec 12, 2012 at 4:48 PM, Daniel DeLeo < " target="_blank"> > wrote:
On Tuesday, December 11, 2012 at 5:22 PM, Jesse Campbell wrote:

Okay, so what would you like to see? FileCopy provider for local file operations, and CookbookFile extends FileCopy? Where to put Bryan's move?

Happy to go about this differently, but a local option to cookbookfile seems backwards

I agree a local option to cookbook file isn't the right way to go. My favored options are either a file_copy resource and provider, or a local option to remote file.

I dislike the idea of a file_copy resource - I think it's because I parse it as an imperative (copy X to Y).  On the other hand, I see how it could be read declaratively (ensure Y has the same contents as X).  

Permitting a local file URI as remote_file's source (eg: source "file:///path/to/source/file") makes the name of the resource a little misleading, but otherwise fits the way I currently look at the file resources:

file - for asserting that files are absent, or present with contents inlined in the resource declaration.
cookbook_file - for asserting files exist, with contents from a file shipped with the cookbook
remote_file - for asserting that files exist, with contents coming from elsewhere

That said, I find it difficult to infer the conceptual model that results in three resources distinguished in those ways.  If there is one, I'd expect to find a matching trio of template resources - if not, it sure would be nice to unify the file resources in a future, major release.


Zac



Archive powered by MHonArc 2.6.16.

§