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_user: add "update_password: on_new_username" argument, "password_changed" result field #365

Merged
merged 12 commits into from
May 31, 2022

Conversation

betanummeric
Copy link
Member

SUMMARY

fixes #344

  • Add value on_new_username to update_password argument of module mysql_user.
  • Add result field password_changed boolean to module mysql_user.
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

module mysql_user

ADDITIONAL INFORMATION

When update_password: on_new_username is set, reuse the password (plugin and authentication_string) when creating a new user if some user with the same name already exist. If the existing users with the same name have varying passwords, the password from the arguments is used like with update_password: always.

The result field password_changed is true, when the user got a new password. When the user was created with update_password: on_new_username and an existing password was reused, password_changed is false.

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #365 (91a9823) into main (51a3884) will decrease coverage by 0.38%.
The diff coverage is 54.76%.

@@            Coverage Diff             @@
##             main     #365      +/-   ##
==========================================
- Coverage   78.10%   77.71%   -0.39%     
==========================================
  Files          27       27              
  Lines        2279     2307      +28     
  Branches      552      556       +4     
==========================================
+ Hits         1780     1793      +13     
- Misses        340      354      +14     
- Partials      159      160       +1     
Impacted Files Coverage Δ
plugins/module_utils/user.py 84.48% <37.93%> (-2.68%) ⬇️
plugins/modules/mysql_user.py 82.69% <90.90%> (+1.24%) ⬆️
plugins/modules/mysql_role.py 85.71% <100.00%> (+0.04%) ⬆️

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 51a3884...91a9823. Read the comment docs.

@betanummeric betanummeric marked this pull request as ready for review May 19, 2022 11:09
@betanummeric
Copy link
Member Author

Hi @Andersson007, @rsicart, can you have a look at this?

@Andersson007
Copy link
Collaborator

Andersson007 commented May 31, 2022

for other folks' information: the discussion is happening in the issue

Copy link
Contributor

@bmalynovytch bmalynovytch left a comment

Choose a reason for hiding this comment

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

Code looks good to me, except minor documentation changes.
I didn't look at code covering though.

@Andersson007
Copy link
Collaborator

Rebase is needed

@betanummeric
Copy link
Member Author

rebased onto main

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.

last thing

@Andersson007 Andersson007 merged commit ed3935a into ansible-collections:main May 31, 2022
@Andersson007
Copy link
Collaborator

@betanummeric thanks for the contribution!
@bmalynovytch thanks for reviewing!

@Andersson007
Copy link
Collaborator

@betanummeric have you seen my comment? Would be great to hear your thoughts:)

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_user: add option to reuse password of existing user when creating a new one
4 participants