-
Notifications
You must be signed in to change notification settings - Fork 88
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
password_expire support for mysql_user #598
password_expire support for mysql_user #598
Conversation
Hi @tompal3 . Great start! Thanks for your contribution. When I started to contribute to c.mysql I didn't knew how to find the error messages from the failing tests. So I paste it here in case you didn't saw it already:
To find it, I searched for "FAILED" and hit enter until I saw an error without the light blue text "...ignoring" Do you know why this is failing? |
Thanks for the tip @laurent-indermuehle. Yes I have already fixed it, but now I'm trying to setup ansible integration tests on my wsl ubuntu instance to reduce number of commits and to write some tests for my PR. |
In that case you'll need to adapt the Makefile that I wrote for podman. I think docker will work best in your case. Feel free to ask questions here or in matrix #mysql:ansible.com if you need help. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #598 +/- ##
==========================================
- Coverage 77.04% 75.53% -1.52%
==========================================
Files 28 18 -10
Lines 2501 2420 -81
Branches 618 610 -8
==========================================
- Hits 1927 1828 -99
- Misses 388 407 +19
+ Partials 186 185 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@tompal3 as you mention on Matrix, our scheduled integration tests for the plugins fails with latest Ansible due to jinja templating been forbidden in the assertions. I'm fixing this now. You'll be able to rebase your fork on this to avoid clutter in your patch when I'm done. Thanks for your message. |
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'm quite rusty on the Python part. Also I may have introduced some regression so I apologise in advance if that happen.
As a rule of thumb, if an assertion has only one test, I prefer to use failed_when. This offer a cleaner output (searching for a failed task is easier when you don't have thousand of "failed... ignored" in the log.
tests/integration/targets/test_mysql_user/tasks/test_password_expire.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/test_password_expire.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/test_password_expire.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/utils/assert_user_password_expire.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/utils/assert_user_password_expire.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/utils/assert_user_password_expire.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/utils/assert_user_password_expire.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/utils/assert_user_password_expire.yml
Outdated
Show resolved
Hide resolved
Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
…expire.yml Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
Co-authored-by: Laurent Indermühle <laurent.indermuehle@pm.me>
Thanks for the code review, committed all your suggestions. |
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.
@tompal3 hi, thanks for the great improvement!
Could you please add a changelog fragment to let users know about the added feature?
Any questions? Just ask
Thanks!
plugins/modules/mysql_user.py
Outdated
password_expire=dict(type='str', choices=['now', 'never', 'default', 'interval'], no_log=True), | ||
password_expire_interval=dict(type='int', no_log=True), |
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.
password_expire=dict(type='str', choices=['now', 'never', 'default', 'interval'], no_log=True), | |
password_expire_interval=dict(type='int', no_log=True), | |
password_expire=dict(type='str', choices=['now', 'never', 'default', 'interval'], no_log=True), | |
password_expire_interval=dict(type='int', no_log=True), |
why do we no_log
them?
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.
no reason why we should, will remove that one.
hello, any updates on this? |
Hi, sorry missed your previous comment, will check it this week. |
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
@tompal3 there's a sanity failure:
needs to be fixed before merging |
@Andersson007 ok, I have remembered now, sanity checks fails if variable containing password key word is not set to |
Only way I found to get rid of an old request for changes I did was to validate the whole PR. Thought I'm too busy now to do a full review, so please ignore my vote on this one (I skimmed, it looks not bad at all thought). You can ping me if necessary. |
changelogs/fragments/598-password_expire-support-for-mysql_user.yml
Outdated
Show resolved
Hide resolved
…r.yml Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
40af258
into
ansible-collections:main
@tompal3 thanks for the contributing! @tompal3 FYI we have a forum group and a matrix channel, see the communication guide for details. |
SUMMARY
Add new feature to support password expire policy for users as discussed in: #513
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
new features will include setting password_lifetime policy for creating or altering user:
default_password_lifetime
.