-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ipa: add environment fallback support for validate_certs #10753
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
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Please ignore that sanity error failures, #10755 is adding the necessary ignores. |
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.
Thanks for your contribution!
I would change the environment variable's name to ANSIBLE_IPA_VALIDATE_CERTS
, since we prefer to prefix all environment variables with ANSIBLE_
unless these variables are also interpreted in the same sense by the software that the module manages (which very likely isn't the case here).
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.
Other than the comments by @felixfontein , looks good to me
- If the value is not specified in the task, the value of environment variable E(IPA_VALIDATE_CERTS) is used instead. | ||
If both the environment variable E(IPA_VALIDATE_CERTS) and the value are not specified in the task, then default value is used. |
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.
- If the value is not specified in the task, the value of environment variable E(IPA_VALIDATE_CERTS) is used instead. | |
If both the environment variable E(IPA_VALIDATE_CERTS) and the value are not specified in the task, then default value is used. | |
- If the value is not specified in the task, the value of environment variable E(ANSIBLE_IPA_VALIDATE_CERTS) is used instead. | |
If both the environment variable E(ANSIBLE_IPA_VALIDATE_CERTS) and the value are not specified in the task, then default value is used. |
ipa_pass=dict(type='str', no_log=True, fallback=(env_fallback, ['IPA_PASS'])), | ||
ipa_timeout=dict(type='int', default=10, fallback=(env_fallback, ['IPA_TIMEOUT'])), | ||
validate_certs=dict(type='bool', default=True), | ||
validate_certs=dict(type='bool', default=True, fallback=(env_fallback, ['IPA_VALIDATE_CERTS'])), |
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.
validate_certs=dict(type='bool', default=True, fallback=(env_fallback, ['IPA_VALIDATE_CERTS'])), | |
validate_certs=dict(type='bool', default=True, fallback=(env_fallback, ['ANSIBLE_IPA_VALIDATE_CERTS'])), |
@felixfontein The other environment vars already start with Anecdotally, it has been my experience that module-specific environment variables use a custom prefix matching the module names, such as the use of |
These have been grandfathered in, since they were added before the
True, but that doesn't change that the prefix should be used for new environment variables. (Also it's possible to add additional env variable fallbacks for the existing options that have a prefix.) |
SUMMARY
Add an environment fallback
IPA_VALIDATE_CERTS
for thevalidate_certs
parameter in the ipa module utils. Currently you can set all connection-related parameters via the environment, except for this one.ISSUE TYPE
COMPONENT NAME
ipa
ADDITIONAL INFORMATION