Skip to content
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: don't add members to a role when creating the role and "detach_members: true" is set #367

Merged

Conversation

betanummeric
Copy link
Member

BUGFIX: fixes #366 (the "adding unwanted members" part)

SUMMARY

In the mysql_role module, if the argument detach_members is true, the role should be revoked from the users specified in the members argument (if necessary). This PR fixes this behavior for when the role does not exist and is created (avoid granting the role to the users).

…etach_members: true" is set, add integration test
@codecov
Copy link

codecov bot commented May 20, 2022

Codecov Report

Merging #367 (684c48c) into main (cc950cb) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #367      +/-   ##
==========================================
+ Coverage   78.23%   78.25%   +0.01%     
==========================================
  Files          27       27              
  Lines        2270     2272       +2     
  Branches      551      552       +1     
==========================================
+ Hits         1776     1778       +2     
  Misses        335      335              
  Partials      159      159              
Impacted Files Coverage Δ
plugins/modules/mysql_role.py 87.45% <100.00%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc950cb...684c48c. Read the comment docs.

@Andersson007
Copy link
Collaborator

@betanummeric thanks for the fix! Could you please:

  • add a changelog fragment
  • feel free to add yourself as a module's author (authors: key in DOCUMENTATION)

Copy link
Collaborator

@Andersson007 Andersson007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@betanummeric LGTM thanks! Let's make the changelog view consistent, could you please change it as suggested? After that I'll merge the PR

changelogs/fragments/367-mysql_role-fix-deatch-members.yml Outdated Show resolved Hide resolved
@Andersson007 Andersson007 merged commit ceda766 into ansible-collections:main May 25, 2022
@Andersson007
Copy link
Collaborator

@betanummeric thanks for the contribution!

@Andersson007
Copy link
Collaborator

Backported manually #372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mysql_role: multiple bugs with detach_members
3 participants