Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. salt% cat files/auth_query.sh
  2. psql ${PSQL_ARGS} <<EOF
  3. CREATE OR REPLACE FUNCTION pgbouncer.user_lookup(in i_username text, out uname text, out phash text)
  4. RETURNS record AS \$\$
  5. BEGIN
  6. SELECT usename, passwd FROM pg_catalog.pg_shadow
  7. WHERE usename = i_username INTO uname, phash;
  8. RETURN;
  9. END;
  10. \$\$ LANGUAGE plpgsql SECURITY DEFINER;
  11. REVOKE ALL ON FUNCTION pgbouncer.user_lookup(text) FROM public, pgbouncer;
  12. GRANT EXECUTE ON FUNCTION pgbouncer.user_lookup(text) TO pgbouncer;
  13. EOF
  14.  
  15. salt% cat chouffe.sls
  16. #!yaml|gpg
  17.  
  18. pgbouncer:
  19. config:
  20. pgbouncer:
  21. auth_user: pgbouncer
  22. auth_query: SELECT * FROM pgbouncer.user_lookup($1)
  23. admin_users: admin
  24. log_connections: 0
  25. log_disconnections: 0
  26. log_pooler_errors: 1
  27. verbose: 0
  28. server_lifetime: 1800
  29. databases:
  30. '*': host=db.prod.lan auth_user=pgbouncer
  31. afromoths: auth_user=pgbouncer pool_mode=transaction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement