ark
ark copied to clipboard
Ark continues to download file when the file is already present
Ark is always downloading the remote_file, can we not add a new attribute say redownload = true/false, which can then internally check for the existence of the archive and skip downloaded if needed.
Seeing this too.
+1 I would imagine a simple check for if checksum matches, to skip download ... otherwise headache when files being downloaded > 500mb
The checksum
attribute can be used to avoid re-downloading a file when already present on the system. Of course, it requires to specify the expected checksum.
Note that in the past (ark ~0.1), the checksum
attribute was providing a security check, which has been lost when ark code switched to Chef remote_file
, as reported in #55. https://github.com/devrandom/ark/commit/86bd1fe1bd684147edee50a6ea15c4cf6af7ec95 removed checksum
from the documentation, but actually this attribute is still present but with a different behavior:
From https://docs.getchef.com/resource_remote_file.html:
Use to prevent the remote_file resource from re-downloading a file. When the local file matches the checksum, the chef-client will not download it.
I feel that many people get confused with the checksum
behavior (even when using remote_file
resource) and I wonder if you are also interested to provide again a handful of features:
- [ ] add
redownload
attribute (by default set totrue
). If set tofalse
no more download will be executed when a file is locally present (no checksum verification is applied in this case). - [x]
checksum
attribute is used to avoid unnecessary download effort - [ ] raise an error if download file mismatch
checksum
atttribute
Pending: Define the priority rules between redownload
and checksum
(e.g. what to do when redownload == false && checkum != nil
)
@burtlo interested to align all that?
I read this before writing #201... but after writing #201 I think maybe some relation?