Comments (4)
I think you need to use actual values where you have 'nil' or at least use '', but I don't think the .nil checks in the code will handle that right.
I think the code needs something like this:
if name.nil? || name.empty?
from puppet-vault_lookup.
@BobSF67
i'm fairly certain that the function is getting to the api call in get_token
. i have added more info in the OP
from puppet-vault_lookup.
@andrewjkeith nil
in Puppet is treated as the literal string "nil"
. Since the lookup function takes positional arguments, you'll want to use undef
instead.
For example, try this:
$role_id = 'xxxxxx'
$secret_id = 'yyyyy'
$d = Deferred('vault_lookup::lookup', ['aws/creds/build_role', 'https://vault:8200', undef, undef, undef, undef, 'approle', $role_id, $secret_id])
notify { 'vault':
message => $d,
}
Also note that as of PR #64 , you can use a hash of options rather than positional arguments. Which would make this simpler for you.
However that change hasn't been released yet, so you'll need to wait for the next version of this module after 0.6.0
.
$role_id = 'xxxxxx'
$secret_id = 'yyyyy'
# This will only work after version 0.6.0 of the module:
$d = Deferred('vault_lookup::lookup', ['aws/creds/build_role', {
'vault_addr' => 'https://vault:8200',
'auth_method' => 'approle',
'role_id' => $role_id,
'secret_id' => $secret_id,
}])
notify { 'vault':
message => $d,
}
from puppet-vault_lookup.
Closing this issue as the problem was due to improperly calling the function with positional arguments. Use undef
instead of nil
. Or even better, use the options hash as the 2nd argument like in the example from my comment above.
The options hash feature is available as of version 0.7.0
.
from puppet-vault_lookup.
Related Issues (20)
- Please release 1.1.1 with approle trailing / url fix.
- Disable Cache
- certificate failed to verify with self signed certificates HOT 1
- Server error 500 after upgrade of Puppet Enterprise 2023.5 to 2023.7
- Issue gathering multiple fields from a secret in vault HOT 1
- [Feature Request] Ability to use a list of Vault nodes HOT 3
- Specifying different login endpoint HOT 1
- Error: Failed to apply catalog: undefined method `http_ssl_instance' for Puppet::Network::HttpPool:Module HOT 2
- Update function for work with Vault secured with Letsencrypt certificates HOT 5
- Per-client cert policies possible? HOT 4
- Detection of what kv version the vault is should be done via a different heuristic. HOT 2
- error: "client certificate must be supplied" HOT 2
- bolt with approle
- undefined local variable or method 'vault_role_id'
- Retreiving a field value fails. HOT 1
- Issue authenticating to Vault using AppRole method
- Can't load environment variables from /etc/sysconfig/puppet HOT 1
- Contact Vault with Self-signed CA HOT 2
- Features: Token caching and rate-limit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-vault_lookup.