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

Fix connect_params being ignored on postgresql_privs #451

Conversation

JohnAtOlo
Copy link
Contributor

SUMMARY

Fixes #450
Where connect_params were ignored for community.postgresql.postgresql_privs

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

postgresql_privs

ADDITIONAL INFORMATION

Previous connect_params were ignored. A helper method used in postgresql_user took care of this and other checking which was being done here, including unix socket check.

The end result is connect_params being properly honored now.

connect_params with:

    connect_params:
      sslcert: "{{ db_cert }}"
      sslkey: "{{ db_key }}"
      sslrootcert: "{{ db_ca }}"

Before: (fails with cert error, same cert error I get if I leave out connect_params entirely)

failed: [foo -> 127.0.0.1] (item={'privs': 'ALL', 'objs': 'tables', 'type': 'default_privs'}) => {"ansible_loop_var": "privilege", "changed": false, "msg": "Could not connect to database: connection to server at \"<redacted>\" (<redacted>), port 443 failed: SSL error: sslv3 alert bad certificate\n", "privilege": {"objs": "tables", "privs": "ALL", "type": "default_privs"}}

After: (uses the connect_params successfuly, like community.postgresql.postgresql_membership and community.postgresql.postgresql_user do)

ok: [foo -> 127.0.0.1] => (item={'privs': 'ALL', 'objs': 'tables', 'type': 'default_privs'})

@JohnAtOlo JohnAtOlo force-pushed the issue-450-fix-postgresql_privs-ignoring-connect_params branch from 655ce55 to edd7c12 Compare April 19, 2023 00:06
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.

LGTM

@Andersson007 Andersson007 merged commit bbb3257 into ansible-collections:main Apr 20, 2023
@ansible-collections ansible-collections deleted a comment from patchback bot Apr 20, 2023
@Andersson007
Copy link
Collaborator

@JohnAtOlo thanks for the contribution!
@hunleyd thanks for reviewing!

Our bot failed to backport the patch to stable-1 as there are conflicts.
@JohnAtOlo would you like to manually backport it to stable-1? Here's the guide (use main instead of devel).
If no time, let us know.

@JohnAtOlo
Copy link
Contributor Author

@Andersson007 the link you have there isn't loading for me.

@Andersson007
Copy link
Collaborator

JohnAtOlo added a commit to JohnAtOlo/community.postgresql that referenced this pull request Apr 21, 2023
@JohnAtOlo
Copy link
Contributor Author

Backport PR up at #455 @Andersson007

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.

postgresql_privs ignores connect_params
3 participants