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

Allow passwords to be deferred #497

Open weavage opened 1 year ago

weavage commented 1 year ago

Affected Puppet, Ruby, OS and module versions/distributions

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

Specify an archive that uses username and password

$password = Deferred('vault_lookup::lookup', ["secret/test", 'https://vault.hostname:8200'])

archive { '/tmp/some_name.tar':
  ensure       => present,
  source       => $source_uri,
  user         => 'root',
  group        => 'root,
  username     => 'user',
  password     => $password,
  proxy_server => 'http://proxy.server'
  proxy_type   => 'http',
}

What are you seeing

The vault_lookup object is being inserted into the URI instead of the actual value of the vault_lookup. See log output below.

What behaviour did you expect instead

The password lookup to be deferred.

Output log

Error: Could not set 'present' on ensure: bad URI(is not URI?): "https://user:Deferred({'name' => 'vault_lookup::lookup', 'arguments' => ['secret/test', {'vault_addr' => 'https://vault.hostname:8200'}]})@source.url.com/some_name.tar" (file: .... manifests/init.pp, line: ###)

Any additional information you'd like to impart