generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 90
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
mysql_role: multiple bugs with detach_members #366
Comments
This was referenced May 20, 2022
Hi @bmalynovytch, @Jorge-Rodriguez, @rsicart, @Andersson007, can you please take a look at this? :) |
@Andersson007 There are still multiple open pull requests for this issue, so I would recommend to reopen this issue. |
@betanummeric i didn't close it:) It was closed automatically because there's |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ISSUE TYPE
AFFECTED VERSIONS
ansible 2.10.8
community.mysql 3.2.1, mysql_role module
SUMMARY
The
detach_members
argument of the mysql_role module is documented as follows:adding unwanted members
When the role does not exist, it is created and the users specified in
members
are added instead of detached, regardless ofdetach_members
.See the lack of
detach_members
here: https://github.com/ansible-collections/community.mysql/blob/main/plugins/modules/mysql_role.py#L1067-L1071detaching too few members
Detecting the existing members of a role does not work if the
SHOW GRANTS
statement uses other quotes than backticks (`). I checked MariaDB 10.{1-6} and MySQL 5.7, 8.0, with and without ANSI_QUOTES SQL-mode, and found either single or double quotes ('
/"
), so I don't know why the module expects backticks. This causes that existing members are added again (redundant) and no unwanted members are detached.The backticks are assumed here:
https://github.com/ansible-collections/community.mysql/blob/main/plugins/modules/mysql_role.py#L691
https://github.com/ansible-collections/community.mysql/blob/main/plugins/modules/mysql_role.py#L697
On MariaDB 10.6, notice the double quotes:
raising too much errors
When a user which shall be detached from a role does not exist, the module fails. I would like the module to ignore this user. Other people may expect the failure, so we could add a flag (e.g.
members_must_exist
, default true) to toggle failing/ignoring.steps to reproduce
The text was updated successfully, but these errors were encountered: