puppet-vault_lookup
puppet-vault_lookup copied to clipboard
Simplify module usage by wrapping deferred objects
Simplify module usage by a wrapper function.
Instead of
$d = Deferred('vault_lookup::lookup', ['secret/test', 'https://vault.hostname:8200'])
use
$d = vault_lookup::kv('secret/test')
where appropriate Vault server can be retrieved from Hiera:
---
vault_lookup::server: 'https://vault.hostname:8200'
the code becomes:
$d = vault_lookup::kv('secret/test', {'vault_addr' => 'https://vault.hostname:8200'})
Additionally there's a vault_lookup::fmt() function for deferred formating:
vault_lookup::fmt('password=%<pass>s', {'pass' => $d })
This looks pretty good if it works!
@tskirvin It does work :smiley: Just the fmt function seems to be limited to Puppet >=8 - somehow deferred unwrap doesn't work well with Puppet 7.