-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add ability to use ansible vars to specify options #86
Conversation
Codecov Report
@@ Coverage Diff @@
## main #86 +/- ##
=======================================
Coverage 82.88% 82.88%
=======================================
Files 16 16
Lines 783 783
Branches 78 78
=======================================
Hits 649 649
Misses 120 120
Partials 14 14
Continue to review full report at Codecov.
|
cc @h3m5k @erinn @morco @elcomtik @pilou- @wenottingham @infra-monkey Would you be able to try out this PR with AWX and see if it meets your needs for supplying values that don't rely on environment variables? |
I'v tested this with AWX 15.0.1 and ansible 2.10.6 and it works like a charm. Let me know if you'd like me to try something else. |
@h3m5k great! thanks a lot, I really appreciate that extra testing. Given how important it is to AWX users I wanted someone to use it hands-on before merging in case anything else was needed. |
SUMMARY
Fixes #49
Fixes #65
The big change here is adding
vars:
entries for several options:url ->
ansible_hashi_vault_url
ansible_hashi_vault_addr
proxies -> ansible_hashi_vault_proxies
namespace -> ansible_hashi_vault_namespace
token -> ansible_hashi_vault_token
token_validate -> ansible_hashi_vault_token_validate
role_id -> ansible_hashi_vault_role_id
secret_id -> ansible_hashi_vault_secret_id
auth_method -> ansible_hashi_vault_auth_method
Some new examples of usage:
Important Note
Using templating in task vars won't work because of ansible/ansible#73268 so this example will fail:
Instead, use
set_fact
to ensure your vars are evaluated beforehand.Other Changes
validate_certs
option, checking different types of ways to specify yes/no, but they used environment variables via theenvironment:
keyword which doesn't affect the lookup anyway. They have been removed, as unit tests now cover the various ways of supplying that option.proxies
option as a dict via an ansible var.ISSUE TYPE
COMPONENT NAME
hashi_vault
ADDITIONAL INFORMATION