-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat[mysql_info]: add 'users_info' filter #580
feat[mysql_info]: add 'users_info' filter #580
Conversation
Mysql_info use a DictCursor and mysql_user a normal cursor.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #580 +/- ##
==========================================
- Coverage 76.35% 74.77% -1.59%
==========================================
Files 28 18 -10
Lines 2394 2319 -75
Branches 584 583 -1
==========================================
- Hits 1828 1734 -94
- Misses 390 405 +15
- Partials 176 180 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
@laurent-indermuehle thanks a lot for the PR!
Causes issues when authentications plugins C(sha256_password) and C(caching_sha2_password).
What kind of issues? Will the module not fail? Or you mean issues for migration?
Anyway, if i have such questions, I think it's worth elaborating a bit more on the issues in the doc;)
UPDATE: Also how about renaming the key to user_accounts
?
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
You're right, I was vague. I've pushed an explanation along with your suggestion of using a list in the description instead of a long sentence. user_accounts is a far better name than users_privs (user_ or users_ thought?) I'll need to rename everything. I'll do this soon. |
@laurent-indermuehle how about |
Users is already used. |
|
I added a description for the old users:
description: Users informations
users_info:
description: Information about users accounts... If someone knows a use case for this filter, we could add it to the description. |
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.
SGTM
3ef9bda
into
ansible-collections:main
@laurent-indermuehle 🎉 thanks! |
SUMMARY
Add the filter
users_info
to themysql_info
module.ISSUE TYPE
COMPONENT NAME
mysql_info
ADDITIONAL INFORMATION
This filter returns information about users accounts. Useful when migrating accounts to a new server or to help exporting accounts in YAML that can be placed in an Ansible inventory.
To migrate accounts, feed the output of
mysql_info
directly tomysql_user
.To export the accounts definition, use a playbook that writes the output of
mysql_info
into a file or just ansible.builtin.debug if you have very few accounts.It doesn't return information about
password_option
andlock_option
but since themysql_user
module doesn't support them, I didn't implemented them.Doesn't support
sha256_password
andcaching_sha2_password
authentication plugins. Even if you useprint_identified_with_as_hex
to convert the password into a hash. I think this is because PyMySQL andmysqlclient wrap the password in quote:
CREATE USER... IDENTIFIED AS '0x1234'
instead ofCREATE USER... IDENTIFIED AS 0x1234
. Sorry to leave that unfinished but this issue is too much work for one who only works on MariaDB withmysql_native_password
.