-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support templating of the API token #98
Conversation
This is a neat idea, thank's for contributing. |
I wonder if there's a function we can call to trigger interpolation, like this: plugin: community.digitalocean.digitalocean
api_token: "{{ lookup('pipe', './get-do-token.sh') }}" |
Oh that is actually a much better idea. That shouldn't be too hard to implement, since it's being used all over the place in Ansible. I'll look into it later today. |
Codecov Report
@@ Coverage Diff @@
## main #98 +/- ##
==========================================
+ Coverage 62.33% 64.78% +2.45%
==========================================
Files 30 1 -29
Lines 2153 71 -2082
Branches 411 11 -400
==========================================
- Hits 1342 46 -1296
+ Misses 577 23 -554
+ Partials 234 2 -232 Continue to review full report at Codecov.
|
@mamercad Done! I changed the example to showcase the use of a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great -- thanks so very much! 🎉
SUMMARY
This PR adds support for templates in the API token field. This mechanism allows retrieving the password from arbitrary sources (for example, a password manager).
TODO
ISSUE TYPE
COMPONENT NAME
Inventory plugin
ADDITIONAL INFORMATION
Example script
get-do-token.sh
that just writes the API token to stdout:Inventory config
inventory_digitalocean.yml
, referencing the script: