voxpupuli / puppet-wget

A puppet recipe for wget, a useful tool to download arbitary files from the web
Apache License 2.0
41 stars 114 forks source link

Adding the possibility to specify the unless condition manually #59

Closed apazga closed 9 years ago

apazga commented 9 years ago

This way users can add their specific condition (not just if the file exist or need to be replaced)

E.g. thinking about the possibility, to automatically download the latest version of Wordpress in the VirtualHost directory just if the directory if empty (and, e.g., if it already have been deployed/uncompressed, I don't want wget to download it anymore).

wget::fetch { 'wget_wordpress':
    source      => 'https://wordpress.org/latest.tar.gz',
    destination => "$webserver_wwwroot/latest_wordpress.tar.gz",
    timeout     => 0,
    unless      => 'test "$(ls -A . 2>/dev/null)"',
  }
carlossg commented 9 years ago

Can you add some docs, tests?

earsdown commented 9 years ago

+1 for this. Also, a 'refreshonly' capability would be awesome.

apazga commented 9 years ago

After some tests, new pull request sent. README.md updated too with an example. Hope it helps.