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
use default values if environment variables are undefined #51961
Conversation
use the default values if ANSIBLE_CONSUL_URL is set, but ANSIBLE_CONSUL_VALIDATE_CERTS and ANSIBLE_CONSUL_CLIENT_CERT are undefined
validate_certs = os.environ['ANSIBLE_CONSUL_VALIDATE_CERTS'] or True | ||
client_cert = os.environ['ANSIBLE_CONSUL_CLIENT_CERT'] or None | ||
validate_certs = os.environ.get('ANSIBLE_CONSUL_VALIDATE_CERTS', True) | ||
client_cert = os.environ.get('ANSIBLE_CONSUL_CLIENT_CERT', None) |
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.
instead of manually assembling all the options, use set_options/get_option and all this will be resolved 'per option' in normal precedence order
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.
I just checked to code of the redis lookup, and yes that a better approach. I will update the pull request.
@provonet Thanks for the contribution. superseded by ansible-collections/community.general#303 |
use the default values if ANSIBLE_CONSUL_URL is set, but ANSIBLE_CONSUL_VALIDATE_CERTS and ANSIBLE_CONSUL_CLIENT_CERT are undefined
SUMMARY
fix for issue #51960
ISSUE TYPE
COMPONENT NAME
consul_kv lookup plugin
ADDITIONAL INFORMATION