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

Postgresql_query and Postgresql_* modules do not provide option for target_session_attrs #69

Closed
zmehu opened this issue Mar 22, 2021 · 7 comments

Comments

@zmehu
Copy link

zmehu commented Mar 22, 2021

SUMMARY

Postgresql_* modules use Python psycopg2 library and this library allow use when connection to cluster attribute target_session_attrs. When we set target_session_attrs="read-write" we will connect to master/write host. It's useful when we use PostgreSQL clusters.

ISSUE TYPE
  • Provide attribute target_session_attrs and passthrough to psycopg2
COMPONENT NAME

postgresql_query, postgresql_user, postgresql_db

ADDITIONAL INFORMATION

This postgres modules are based on psycopg2 python module and this module support target_session_attrs and cluster connection. Current ansible modules require extension for supporting this attribute on connection part.

conn = psycopg2.connect(host="ip1,ip2",
            port=port,
            database=db,
            user=user,
            password=pass,
            sslmode='require',
            target_session_attrs="read-write")
@Andersson007
Copy link
Collaborator

@zmehu , hi, thanks for the feature idea, sounds very interesting though I'm not an expert. Do you like to implement this yourself?
We should be careful about the driver versions - that all of them support it.

@tcraxs @andytom @Dorn- @popov83 @sebasmannem @kostiantyn-nemchenko what do you think?

@SzymonMGR
Copy link

Is there any updates for that case ? Implementation already done maybe since creation of that case ?
Thanks a lot for any further updates / informations( if any ).

@Andersson007
Copy link
Collaborator

@SzymonMGR hello, thanks for reminding! If you'd like to add these options, please go ahead (but let us know before),
otherwise I'll ping folks directly. What do you think?

@SzymonMGR
Copy link

Hi ! Maybe it's possible to try with gitlab team firstly ?

@Andersson007
Copy link
Collaborator

Hi ! Maybe it's possible to try with gitlab team firstly ?

I don't understand, could you elaborate a bit more?

@SzymonMGR
Copy link

Sure - with pinging folks directly. "... otherwise I'll ping folks directly." ;)

@Andersson007
Copy link
Collaborator

implemented in #329,

Thanks everyone!

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

No branches or pull requests

3 participants