Skip to content

Allow passwords to be deferred #497

@weavage

Description

@weavage

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions