puppet-archive icon indicating copy to clipboard operation
puppet-archive copied to clipboard

Allow passwords to be deferred

Open weavage opened this issue 1 year ago • 0 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.20.0
  • Ruby: 2.7.6p219
  • Distribution: Ubuntu 20.04.6
  • Module version: 6.1.1

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

weavage avatar May 16 '23 18:05 weavage