file.managed is TOO secure
In ./salt/salt/modules/file.py the method ...
get_managed(
name,
template,
source,
source_hash,
etc, etc,
... demands inflexibly that the remote source provide a valid checksum for every file of type http, https or ftp.
Not all remote sources can be counted on to provide one. An alternative is needed, since a check sum is still required internally, once a file has been retrieved.
file.get_managed should agree with pkg.installed and permit a skip_verify argument. In that event, rather than check the validity of a check_sum, the routine should generate one as soon as the file is fully acquired.
Sounds great! Thanks for the report.
Thank you! I hope to be more help than that in future.
On Mon, Dec 16, 2013 at 2:12 PM, Colton Myers [email protected]:
Sounds great! Thanks for the report.
— Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/9272#issuecomment-30690234 .
+1, this affects the archive.extracted state as well, when attempting to retrieve from a third party website (i.e. dynamically pulling in wordpress plugins).
EDIT: Patch from #9446 does allow the download and extraction to proceed, however as the name is munged when passed to the implicit file.managed state, and the filename which is searched for in the hash file is the munged file name, you are unable to effectively use a file with more than one hash present. I'm not sure if you want this in a separate issue or not.
+1000
Is using cmd.run with 'curl' the only other option while we wait for this feature?
You can also curl the file down once, calculate the checksum yourself, and use that for the file.managed state.
+1
ZD-616
Should we split out the name munging issue for the separate hash file, or has that been done already?
@garrickp can you please clarify?
For context see my edit to my initial comment - basically you can't use the hash file option for checking hashes on downloaded objects.