Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not download if wget::fetch { redownload => false } #26

Closed
miroslavhruz opened this issue May 29, 2014 · 3 comments
Closed

Do not download if wget::fetch { redownload => false } #26

miroslavhruz opened this issue May 29, 2014 · 3 comments

Comments

@miroslavhruz
Copy link

Add option to not download if some other condition is true..
for example downloaded file is zip (or zip of zip) which contains directory which if is unzipped fetching it again from internet is nonsense.

Add possibility to force download/ not download by redownload variable or another? variable from other test than destination exists.

Is it reasonable for you?

Thanks

@carlossg
Copy link
Member

carlossg commented May 1, 2015

should be working now using the parameter source_hash

@c33s
Copy link
Member

c33s commented Sep 28, 2016

if i take the topic of this issue source_hash doesn't fix the problem. for using source_hash i have to know the md5 hash (which means i have to get it manually one time).
in my case i want to download the blocklist https://lists.blocklist.de/lists/all.txt one time if it does not exist. after that i would update it via cron. the first call to wget only ensures that the file is there and the blocklist is not empty.
this means compared to exec that a creates parameter would be awesome see https://docs.puppet.com/puppet/latest/reference/type.html#exec-attribute-creates

@c33s
Copy link
Member

c33s commented Sep 28, 2016

found a solution, just commenting here if someone else stumble upon this issue, unless is the magic key.

wget::fetch { $url:
  destination => $file,
  unless      => "test -f ${file}"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants