puppet-archive icon indicating copy to clipboard operation
puppet-archive copied to clipboard

checksum_url will run test on every puppet run

Open bissa opened this issue 6 years ago • 2 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.2.0-1
  • Ruby: 2.5.3p105
  • Distribution: Ubuntu 18.04 LTS
  • Module version: 3.2.1

How to reproduce (e.g Puppet code you use)

run puppet agent -t --debug

$version = 9.0.16, archive { "/opt/staging/tomcat9/apache-tomcat-${version}.tar.gz": provider => 'wget', ensure => present, extract => true, extract_path => '/opt/staging/tomcat9', source => "http://archive.apache.org/dist/tomcat/tomcat-9/v${version}/bin/apache-tomcat-${version}.tar.gz", checksum_type => 'sha512', checksum_url => "http://archive.apache.org/dist/tomcat/tomcat-9/v${version}/bin/apache-tomcat-${version}.tar.gz.sha512", creates => '/opt/staging/tomcat9', cleanup => false, proxy_server => 'http://localhost:3142', proxy_type => 'http', before => Tomcat::Instance["tomcat"], require => [ File["/opt/staging"], File["/opt/staging/tomcat9"], ], }

What are you seeing

Debug: Executing: 'wget -qO- http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.16/bin/apache-tomcat-9.0.16.tar.gz.sha512 --max-redirect=5 -e use_proxy=yes -e http_proxy=http://localhost:3142' Also it is hitting the proxy access.log

What behaviour did you expect instead

checksum_url to check once when it is actually downloading a .tar.gz file.

bissa avatar Feb 20 '19 13:02 bissa

The checksum URL is checked every time, because it's used to determine if the source file has changed and needs to be re-downloaded.

philomory avatar Apr 10 '19 19:04 philomory

you are correct, but what is the use of the 'creates' then?

I want to use archive to download the latest version of a package on a new installation, but old installations get updates from another source. So hence a 'creates' , but this does download the file again, because the checksum also changed off course. How to stop that !

ralfbosz avatar May 14 '20 09:05 ralfbosz