-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 tls parameter to redis module #4207
Add tls parameter to redis module #4207
Conversation
a6d1676
to
dff30ef
Compare
dff30ef
to
3eb4b86
Compare
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 wonder whether it wouldn't be better to directly use the redis
module_utils and docs_fragment; that would add a few more features to this module.
The main reason against that is right now that this would add another dependency (certifi) to this module. But if the module_utils is changed so that certifi is only required when tls=true
, this would be ok, since so far this module didn't support TLS at all.
But if we add the tls
option manually, this module will behave different from the other redis modules, and it won't be possible to adjust the behvaior (and add the dependency) without a breaking change.
So going that route would be much better.
Co-authored-by: Felix Fontein <[email protected]>
@felixfontein , what you're saying is that it cannot/will not be merged in this form? I did not follow this argument: But if we add the tls option manually, this module will behave different from the other redis modules, and it won't be possible to adjust the behvaior (and add the dependency) without a breaking change. The option I added is the same as for the other redis modules - except the default. Is there a way to use |
I didn't say that.
Yes, you can modify def redis_auth_argument_spec(tls_default = True):
...
tls=dict(type='bool',
default=tls_default),
... Then you can use You should also modify def fail_imports(module, needs_certifi=True):
...
if not HAS_CERTIFI_PACKAGE and needs_certifi:
... Then you can use |
@felixfontein , I upgraded the PR as outlined in your comment. I have tested both redis-data and redis modules. However, I am confident regarding the doc fragments I have created. Is there a way to parametrize doc fragments? If not, I think other options would be to duplicate the doc fragment, either into another fragment or directly into the module. Opinions? |
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
b49f15f
to
fbef11b
Compare
fbef11b
to
e205260
Compare
The commit e205260 undid way too much. You need to keep the changes to the documentation in plugins/modules/database/misc/redis.py. |
@felixfontein , honestly, I do not know which direction you want me to take this. The doc fragment gives a conflicting default value for the TLS option. From my understand, without removing this option from the fragment, I won't be able to use it for the redis module. I see the following options:
Out of your comments I am unable to infer what you would llike to see. Also, I am totally fine with you adding a commit yourself to rectify what ever is wrong in your opinion. |
The correct way is: use the original fragment, and overwrite this specific value from it in the module(s) where you need a different value. |
If nobody complains, I'll merge by the end of this week. |
Backport to stable-4: 💚 backport PR created✅ Backport PR branch: Backported as #4343 🤖 @patchback |
* Add tls parameter to redis module * Rename changelog fragment to match PR * Apply suggestions from code review Co-authored-by: Felix Fontein <[email protected]> * Port redis module to redis auth module util * Update changelogs/fragments/4207-add-redis-tls-support.yml Co-authored-by: Felix Fontein <[email protected]> * Update plugins/modules/database/misc/redis.py Co-authored-by: Felix Fontein <[email protected]> * Undo reuse of redis auth doc fragment * Use doc fragment. Co-authored-by: Julian Faude <[email protected]> Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 9a74ace)
@jcharlytown thanks for your contribution! |
* Add tls parameter to redis module * Rename changelog fragment to match PR * Apply suggestions from code review Co-authored-by: Felix Fontein <[email protected]> * Port redis module to redis auth module util * Update changelogs/fragments/4207-add-redis-tls-support.yml Co-authored-by: Felix Fontein <[email protected]> * Update plugins/modules/database/misc/redis.py Co-authored-by: Felix Fontein <[email protected]> * Undo reuse of redis auth doc fragment * Use doc fragment. Co-authored-by: Julian Faude <[email protected]> Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 9a74ace) Co-authored-by: jcharlytown <[email protected]>
SUMMARY
Add
tls
parameter to redis moduleISSUE TYPE
COMPONENT NAME
module redis
ADDITIONAL INFORMATION
None