[chef] Re: Re: remote_file checksum


Chronological Thread 
  • From:
  • To: " " < >
  • Subject: [chef] Re: Re: remote_file checksum
  • Date: Tue, 11 Mar 2014 15:23:47 +0000

HI Zac,  That ticket describes what I’m getting. (CHEF-4647)

Guess my option is an only_if on the block using to verify checksums 


Thanks to you both. Much appreciate it.

D.



On 11 Mar 2014, at 15:15, Zac Stevens < "> > wrote:

Hi,

On Tue, Mar 11, 2014 at 2:59 PM, < " target="_blank"> > wrote:
I’ve been working with the remote_file  a bit lately. I’m using chef-solo.

I’m misunderstanding the use of checksum attribute ( at least I hope) 

with the following code , should it retry download until retries limit?

remote_file "/tmp/myfile.tmp" do
checksum "incorrect_should_cause_redownload"
retries 3
retry_delay 20
end

My understanding was that it should only fetch the source if the checksums don’t match.
I’ve tried this with forcing the use_conditional_get true and use_etag true.

The point of the checksum attribute is to skip downloading a file you've already got.  When Chef runs, it will checksum the local file - if that matches the checksum in the resource, it assumes it already has the latest copy and doesn't do anything more.  (That's documented, somewhat tersely, here: http://docs.opscode.com/resource_remote_file.html )

Note that the checksum is _not_ used to verify that the file downloaded matches the file you were expecting.  There's an open ticket requesting that behaviour here: https://tickets.opscode.com/browse/CHEF-4647

So, with currently released versions of Chef, the behaviour you'd expect from specifying an incorrect checksum is that Chef will download the file every time it runs.  It will only download it once in each run, and "retries" will only come into play if the download was aborted for some reason.


Zac





Archive powered by MHonArc 2.6.16.

§