generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 92
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
postgresql_user is not idempotent when password is a SCRAM hash #301
Comments
This would be useful addition. Currently doing exactly this in a local fork. Thanks for submitting this! |
@matthbakeredb thanks for the feedback, i think we'll merge the PR this week, there's one thing that needs to be added |
Andersson007
added a commit
that referenced
this issue
Aug 2, 2022
* idempotent when password is scram hashed Add a test to user_should_we_change_password to check if the password parameter is a SCRAM-256 hash, and if it is the same as the stored password. Fixes #301 * Update plugins/modules/postgresql_user.py Co-authored-by: Andrew Klychkov <[email protected]>
patchback bot
pushed a commit
that referenced
this issue
Aug 2, 2022
* idempotent when password is scram hashed Add a test to user_should_we_change_password to check if the password parameter is a SCRAM-256 hash, and if it is the same as the stored password. Fixes #301 * Update plugins/modules/postgresql_user.py Co-authored-by: Andrew Klychkov <[email protected]> (cherry picked from commit bfa3677)
Andersson007
pushed a commit
that referenced
this issue
Aug 2, 2022
* idempotent when password is scram hashed Add a test to user_should_we_change_password to check if the password parameter is a SCRAM-256 hash, and if it is the same as the stored password. Fixes #301 * Update plugins/modules/postgresql_user.py Co-authored-by: Andrew Klychkov <[email protected]> (cherry picked from commit bfa3677) Co-authored-by: Ben Formosa <[email protected]>
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SUMMARY
When providing the
password
parameter as a SCRAM-256 hash, postgresql_user will always give a result of changed.ISSUE TYPE
COMPONENT NAME
community.postgresql.postgresql_user
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
RHEL 8.6
PostgreSQL 13.7 (RHEL App Stream
postgresql:13
)STEPS TO REPRODUCE
Create a user with a task like:
Full example playbook:
https://gist.github.com/benformosa/e6b95b09f0d55377738a6ff85d4189c9#file-play_postgres_user-yml
EXPECTED RESULTS
The second time the postgresql_user task is run, it should not show as changed.
ACTUAL RESULTS
The result is changed both times the task is run.
Full log:
https://gist.github.com/benformosa/e6b95b09f0d55377738a6ff85d4189c9#file-play_postgres_user-log
Full log with
-vvv
:https://gist.github.com/benformosa/e6b95b09f0d55377738a6ff85d4189c9#file-play_postgres_user_vvv-log
Possible solution
A test could be added to check if the stored password is the same as the password parameter, similar to what is done if the given password starts with
md5
:community.postgresql/plugins/modules/postgresql_user.py
Lines 463 to 465 in 3d6d9a7
The text was updated successfully, but these errors were encountered: