voxpupuli/puppet-archive

checksum_url doesn't work for puppet URIs

Opened this issue · 1 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.9
  • Ruby: 2.19
  • Distribution: RHEL7
  • Module version: 3.1.0

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

Using a archive resource and specifying the checksum_url to be a puppet:// URI, for example:

  $_source_url = 'puppet:///installers/client.bin'
  $_checksum_url = "${_source_url}.sha256"
  $_checksum_type = 'sha256'

  # Extract Client
  archive { "/usr/local/src/client.bin":
    ensure        => present,
    extract       => true,
    extract_path  => '/opt/client',
    source        => $_source_url,
    cleanup       => true,
    checksum_url  => $_checksum_url,
    checksum_type => $_checksum_type,
  }

What are you seeing

Puppet agent errors with the following message as it attempts to use curl to download the checksum file rather than the puppet_download function.

Error: Execution of '/usr/bin/curl puppet:///installers/client.bin.sha256 -fsSLg --max-redirs 5' returned 7: curl: (7) Failed connect to puppet:80; Connection refused

Forcing to provider => 'ruby' causes a slightly different error:

change from abset to present failed: Could not set 'present' on ensure: uninitialized constant PUPPET

It seems that problems with checksum_url and Puppet URIs were brought up in #270 as a possible oddity.