voxpupuli / puppet-archive

Compressed archive file download and extraction with native types/providers for Windows and Unix
https://forge.puppet.com/puppet/archive
Apache License 2.0
59 stars 176 forks source link

uninitialized constant PuppetX::Bodeco::PUPPET #471

Open pillarsdotnet opened 2 years ago

pillarsdotnet commented 2 years ago

Affected Puppet, Ruby, OS and module versions/distributions

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

  archive { $archive:
    checksum_type => md5,
    checksum_url  => "${pwcflexera::src}/${flexfile}.md5",
    cleanup       => false,
    extract       => true,
    extract_path  => $target,
    group         => 'Administrators',
    require       => File[$target],
    source        => "${pwcflexera::src}/${flexfile}" ,
    user          => 'System',
  }

What are you seeing

Could not set 'present' on ensure: uninitialized constant PuppetX::Bodeco::PUPPET
Did you mean? Puppet
PuppetX (file: /etc/puppetlabs/code/environments/stage/modules/pwcflexera/manifests/windows.pp, line: 39)
Wrapped exception:
uninitialized constant PuppetX::Bodeco::PUPPET
Did you mean? Puppet
PuppetX

What behaviour did you expect instead

Successful download and extraction.

Output log

2022-04-25 20:06:42,err,"Could not set 'present' on ensure: uninitialized constant PuppetX::Bodeco::PUPPET
Did you mean?  Puppet
               PuppetX (file: /etc/puppetlabs/code/environments/stage/modules/pwcflexera/manifests/windows.pp, line: 39)
Wrapped exception:
uninitialized constant PuppetX::Bodeco::PUPPET
Did you mean?  Puppet
               PuppetX"
2022-04-25 20:06:42,err,"Could not set 'present' on ensure: uninitialized constant PuppetX::Bodeco::PUPPET
Did you mean?  Puppet
               PuppetX (file: /etc/puppetlabs/code/environments/stage/modules/pwcflexera/manifests/windows.pp, line: 39)"

Any additional information you'd like to impart

pillarsdotnet commented 2 years ago

Removed the user and group attributes:

  archive { $archive:
    checksum_type => md5,
    checksum_url  => "${pwcflexera::src}/${flexfile}.md5",
    cleanup       => false,
    extract       => true,
    extract_path  => $target,
    require       => File[$target],
    source        => "${pwcflexera::src}/${flexfile}" ,
  }

But the error persists:

Could not set 'present' on ensure: uninitialized constant PuppetX::Bodeco::PUPPET
Did you mean? Puppet
PuppetX (file: /etc/puppetlabs/code/environments/stage/modules/pwcflexera/manifests/windows.pp, line: 39)
Wrapped exception:
uninitialized constant PuppetX::Bodeco::PUPPET
Did you mean? Puppet
PuppetX
pillarsdotnet commented 2 years ago

Perhaps it is failing because even though the source attribute supports puppet:/// urls, the checksum_url attribute does not.

pillarsdotnet commented 2 years ago

I'm going to try downloading the md5 checksum file as a separate step, then using a file:/// url for the checksum_url attribute.

pillarsdotnet commented 2 years ago

Yup; that's the problem.