Git Product home page Git Product logo

ansible-debian-pgbouncer's Introduction

Ansible-Debian-PgBouncer

This role installs and configures pgbouncer on Debian systems. It is tested on Ubuntu 14.04, but should work on any version for which pgbouncer is available via the default apt repositories.

Requirements

none :-)

Role Variables

See defaults/main.yml for a complete list of variables. All vars are spelled the same as tehy are in pgbouncer.ini, and are prefixed with pgbouncer. Special attention should be given to pgbouncer_auth_users

pgbouncer_auth_users

This is a list of dict objects which each have a name and a pass property. You may use a plaintext or encrypted password.

pgbouncer_auth_users:
  - name: postgres
    pass: pa55word

The above will result in a userlist.txt file that looks like this:

"postgres" "pa55word"

pgbouncer_users_aliases

This is a list of dict objects wich each have a name and max_user_connections property. Allow you to configure pool connections per users.

pgbouncer_users_aliases:
  - name: backyard
    max_user_connections: 30

Dependencies

If you are installing pgbouncer on a server other than your database server, you will also need to install postgresql-client if you want to query statistics. This role can do that for you if you set pgbouner_install_pg_client to true.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: postgres-databases
  vars:
    pgbouncer_database_aliases:
      - name: mydb
        host: 127.0.0.1
        pool_size: 50
        user: my_app
    pgbouncer_auth_users:
      - name: my_app
        pass: md52093480239932090==
    pgbouncer_install_pg_client: False
    pgbouncer_auth_type: md5
  roles:
     - { role: dylancwood.debian-pgbouncer}

License

MIT

More Information

I hope to combine this role with the Redhat pgbouncer role very soon.

ansible-debian-pgbouncer's People

Contributors

bdronneau avatar dylancwood avatar erdnaxeli avatar ma-emounoury avatar velis74 avatar wowane avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

ansible-debian-pgbouncer's Issues

Issue specifying the databases

I just ran into an issue here while specifying multiple databases. They were all declared in one single line in pgbouncer.ini with some spaces between themselves.

Had to insert one additional empty line in the pgbouncer.ini.j2 template between {% endif %} and {% endfor %}. Maybe jinja lately eats some newlines for lines with only commands in them?

Just in case, here's my config:
Ubuntu 19.10, python 3.7.3

pip list:

Package        Version
-------------- -------
ansible        2.9.1  
cffi           1.13.2 
cryptography   2.8    
Jinja2         2.10.3 
jmespath       0.9.4  
libvirt-python 5.9.0  
MarkupSafe     1.1.1  
pip            19.3.1 
pycparser      2.19   
PyYAML         5.1.2  
setuptools     41.6.0 
six            1.13.0 
wheel          0.33.6 

The hosts are all ubuntu 18.04

fatal: apt state must be one of ..., got: installed using more up-to-date ansible

Is this repo still active?
I just tried to use it on ansible 2.9.1 and ubuntu 19.10 and got this error:

TASK [dylancwood.debian-pgbouncer : PGBouncer | Install from apt repo] ***************************************
fatal: [ansible-stump]: FAILED! => {"changed": false, "msg": "value of state must be one of: absent, build-dep, fixed, latest, present, got: installed"}

The issue was easily fixed by changing "installed" to "present" in tasks/main.yml

I could fix up a pull request if further action will be taken.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.