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
60 stars 178 forks source link

Archive resource seems to work with 'puppet apply' but not with 'puppet agent' #425

Open adfel70 opened 3 years ago

adfel70 commented 3 years ago

Affected Puppet, Ruby, OS and module versions/distributions

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

execute agent run using puppet agent --test command with the following resource included inside the manifest:

archive { '/target/filename.tgz':
  ensure => present,
  source  => 'http://file/url/location/filename.tgz',
}

What are you seeing

File /target/filename.tgz does not exist even though manifest applied successfully without any error. (source url is valid and unbroken....)

What behaviour did you expect instead

filename.tgz downloaded under /target directory.

Any additional information you'd like to impart

We are using Puppet with master-agents configuration and we issued this behavior while testing new versions. Using puppetserver 6.13 with puppet-agent 5.5 seems to work. Using puppet-agent version 6.0.0 and up reproduces the described behavior.

Server has one environment (production) with 3 modules:

Even though we have only one environment and seems unrelated, tried also executing

puppet generate types

But still got the same behavior. Any idea? Thanks.

alexjfisher commented 3 years ago

Would you be able to paste the output of puppet agent -t --debug?

kenyon commented 3 years ago
archive { '/target/filename.tgz':
  enssure => present,
  source  => 'http://file/url/location/filename.tgz',
}

I'm guessing that ensure typo is just in this GitHub issue, not in your actual code?

adfel70 commented 3 years ago
archive { '/target/filename.tgz':
  enssure => present,
  source  => 'http://file/url/location/filename.tgz',
}

I'm guessing that ensure typo is just in this GitHub issue, not in your actual code?

Yea sorry about that (I cannot copy-paste the code, had to write it manually)

adfel70 commented 3 years ago

Would you be able to paste the output of puppet agent -t --debug?

Sorry, cant provide the output due to technical limitations (our environment has no internet access...). I Couldn't find anything relevant though: puppet agent -t --debug|grep -i archive or puppet agent -t --debug|grep -i filename showed nothing. It seems like the resource is not even being called, but when I deliberately type incorrect parameter name, like:

archive { '/target/filename.tgz':
  ensure  => present,
  sourceX => 'http://file/url/location/filename.tgz',
}

An error is returned as expected

Server Error: no parameter named 'sourceX' on Archive[/target/filename.tgz]

Is there something specific that may be relevant to look for in --debug output? Thanks again.