Closed LightAxe closed 8 years ago
I did some more digging/experimenting and think the problem is around line 167 in lib/puppet/type/archive.rb
:
newparam(:checksum_url) do
desc 'archive file checksum source (instead of specifying checksum)'
end
newparam(:digest_url) do
desc 'archive file checksum source (instead of specifying checksum)
(this parameter is for camptocamp/archive compatibility)'
munge do |val|
resource[:checksum_url] = val
end
end
My ruby-foo is very weak, but it looks like the checksum_url parameter is inadvertently ignored?
No the type is just munging for compatibility so if someone uses camp to camp archive parameters it passes digest_url value to checksum_url. Based on #204 this is a regression introduced by recent changes so maybe a git bisect will help track it down.
I changed my parameters to use digest instead of checksum and it is working as expected.
On Tue, Aug 30, 2016 at 20:19 Nan Liu notifications@github.com wrote:
No the type is just munging for compatibility so if someone uses camp to camp archive parameters it passes digest_url value to checksum_url. Based on #204 https://github.com/voxpupuli/puppet-archive/issues/204 this is a regression introduced by recent changes so maybe a git bisect will help track it down.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/voxpupuli/puppet-archive/issues/210#issuecomment-243647331, or mute the thread https://github.com/notifications/unsubscribe-auth/ABwFUIh2J6iDQItRJxUfPa4sPgYAIAcLks5qlPLOgaJpZM4JwtWx .
@LightAxe, check and see if #211 resolves this issue.
fixed in #211
Affected Puppet, Ruby, OS and module versions/distributions
Module version: 1.1.1
How to reproduce (e.g Puppet code you use)
archive { "/tmp/pc.war": ensure => present, extract => false, extract_path => '/tmp', source => 'http://build/jboss/pc.war', checksum_url => 'http://build/jboss/pc.war.md5', checksum_type => 'md5', }
What are you seeing
If /tmp/pc.war already exists, nothing happens. If /tmp/pc.war does not already exist, it is downloaded.
What behaviour did you expect instead
If /tmp/pc.war already exists, compare its checksum to the checksum at checksum_url and redownload it if it does not match. If /tmp/pc.war does not exist, download it.
Then validate the local checksum against the remote checksum.
Output log
Let me know if and what log you'd like and I'll grab it!
Any additional information you'd like to impart
The pc.war.md5 file is not being downloaded at all from the web server; I see no mention of it in --debug, and my web server's logs don't mention it being accessed (in either access_log or error_log).
I may be misinterpreting the use of the checksum_url parameter. I'm very open to suggestions and discussion! Ultimately, I need Puppet to recognize when a file on a webserver changes and then update the local copy. I had hoped a simple checksum would solve that problem.