{"id":19756400,"url":"https://github.com/fidanf/ansible-role-pgpool","last_synced_at":"2025-07-23T16:03:52.477Z","repository":{"id":44658763,"uuid":"281876121","full_name":"fidanf/ansible-role-pgpool","owner":"fidanf","description":"Installs and configures PgPool-II for Debian/Ubuntu.","archived":false,"fork":false,"pushed_at":"2022-12-12T16:52:30.000Z","size":130,"stargazers_count":8,"open_issues_count":0,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T11:55:38.420Z","etag":null,"topics":["high-availability","load-balancing","pgpool2","postgresql","replication","watchdog"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fidanf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-23T07:00:26.000Z","updated_at":"2024-08-20T16:17:36.000Z","dependencies_parsed_at":"2023-01-27T22:31:29.514Z","dependency_job_id":null,"html_url":"https://github.com/fidanf/ansible-role-pgpool","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/fidanf/ansible-role-pgpool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fidanf%2Fansible-role-pgpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fidanf%2Fansible-role-pgpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fidanf%2Fansible-role-pgpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fidanf%2Fansible-role-pgpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fidanf","download_url":"https://codeload.github.com/fidanf/ansible-role-pgpool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fidanf%2Fansible-role-pgpool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266708135,"owners_count":23971939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["high-availability","load-balancing","pgpool2","postgresql","replication","watchdog"],"created_at":"2024-11-12T03:15:47.458Z","updated_at":"2025-07-23T16:03:52.450Z","avatar_url":"https://github.com/fidanf.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"PgPool\n=========\n\n[![Build Status](https://travis-ci.com/fidanf/ansible-role-pgpool.svg?branch=master)](https://travis-ci.com/fidanf/ansible-role-pgpool)\n\nInstalls and configures PgPool-II for Debian/Ubuntu. The default _running mode_ is **streaming replication mode**.\n\nTested with :\n  - Debian 10.x :heavy_check_mark:\n  - Debian 11.x :heavy_check_mark:\n  - Ubuntu 18.04.x :heavy_check_mark:\n  - Ubuntu 20.04.x :heavy_check_mark:\n\n\u003e :warning: Only the major 4.1 is currently being handled and tested by this role.  \nWork is in progress to integrate the latest 4.3 which breaks a lot of current things.  \nFor example, to install the version [4.1.4](https://www.pgpool.net/docs/42/en/html/release-4-1-4.html), Debian 11 hosts should set `pgpool_version_debian: 4.1.4-6.pgdg110+1`, whereas Ubuntu 20.04 hosts should rather use `pgpool_version_debian: 4.1.4-6.pgdg20.04+1`.\n\n---\n\n- [PgPool](#pgpool)\n  - [Requirements](#requirements)\n  - [Role Variables](#role-variables)\n  - [Dependencies](#dependencies)\n  - [Example Playbook](#example-playbook)\n  - [Configuration checking commands](#configuration-checking-commands)\n  - [PCP commands](#pcp-commands)\n  - [Handling server reboots](#handling-server-reboots)\n  - [License](#license)\n\nRequirements\n------------\n\n- Python \u003e=3.8\n- Ansible-core \u003e=2.12\n\nSee [./requirements.txt](./requirements.txt) for detailled dependencies used to develop the role.\n\nRole Variables\n--------------\n\nCheck out the [defaults.yml](./defaults/main.yml) file to retrieve the extended list of this role's variables.\n\nDependencies\n------------\n\nNone\n\nExample Playbook\n----------------\n\nCheck out both [inventory.yml](./inventory.yml) and [example.yml](./example.yml) to get a picture of how this role should be used to integrate with an exisiting postgreSQL cluster managed by repmgr.\n\nIf you're looking for a role solely dedicated to provide such an environment, take a look at [ansible-role-postgresql-ha](https://github.com/fidanf/ansible-role-postgresql-ha) \n\nConfiguration checking commands\n------------------------------\n\n:warning: PgPool instance must be running\n\nShow all configuration parameters\n```bash\npgpool@pgpool01:~$ psql -h 192.168.56.30 -p 9999 -U admin -d testdb -c 'PGPOOL SHOW ALL' \n```\n\nShow pool status\n```bash\npgpool@pgpool01:~$ psql -h 192.168.56.30 -p 9999 -U admin -d testdb -c 'SHOW POOL_NODES'\n node_id | hostname | port | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change\n---------+----------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------\n 0       | pgsql01  | 5432 | up     | 0.333333  | primary | 30         | true              | 0                 |                   |                        | 2020-07-27 14:50:55\n 1       | pgsql02  | 5432 | up     | 0.333333  | standby | 13         | false             | 0                 | streaming         | async                  | 2020-07-27 15:26:15\n 2       | pgsql03  | 5432 | up     | 0.333333  | standby | 83         | false             | 0                 | streaming         | async                  | 2020-07-27 14:50:55\n(3 rows)\n```\n\nFeel free to create a .pgpass file for pgpool user in order to skip repetitive password prompts\n\nMore details at : https://www.pgpool.net/docs/latest/en/html/sql-commands.html \n\n:warning: If for any reason PgPool's internal status is no longer in sync with Postgresql Replication' status, issue the following commands :\n```bash\npgpool@pgpool01:~$ sudo systemctl stop pgpool2 \u0026\u0026 rm -f /var/log/pgpool/pgpool_status \u0026\u0026 sudo systemctl restart pgpool2\n```\n\nPCP commands\n------------\n\nGet pgpool status of backend node ID 0 \n```bash\npgpool@pgpool01:~$ pcp_node_info -h 127.0.0.1 -U pgpool -w -v 0\nPassword:\nHostname               : pgsql01\nPort                   : 5432\nStatus                 : 2\nWeight                 : 0.333333\nStatus Name            : up\nRole                   : primary\nReplication Delay      : 0\nReplication State      :\nReplication Sync State :\nLast Status Change     : 2020-07-27 14:50:55\n```\n\nSame thing against standby node\n```bash\npgpool@pgpool01:~$ pcp_node_info -h 127.0.0.1 -U pgpool -w -v 1\nPassword:\nHostname               : pgsql02\nPort                   : 5432\nStatus                 : 2\nWeight                 : 0.333333\nStatus Name            : up\nRole                   : standby\nReplication Delay      : 0\nReplication State      : streaming\nReplication Sync State : async\nLast Status Change     : 2020-07-27 14:50:55\n```\n\nAttach pgpool node and give it and ID\n```bash\npgpool@pgpool01:~$ pcp_attach_node -h 127.0.0.1 -U pgpool -w -n 3\n```\n\nDisplay the parameter values as defined in pgpool.conf\n```bash\npgpool@pgpool01:~$ pcp_pool_status -h /var/run/pcp -U pgpool -w\n```\n\nDisplay PgPool's cluster status\n```bash\npcp_watchdog_info -h 127.0.0.1 -U pgpool -w -v\n```\n\nHandling server reboots\n-----------------------\n\nAlthough using the recommended paths from the official documentation, socket directories seems to have unsufficient privileges to be able to recreate PIDs upon server reboots.\n\nIf you're running PgPool and PostgreSQL on the same servers, you may use the following configuration instead which solves the problem :\n\n```yaml\npgpool_pid_file_name: /var/run/postgresql/pgpool.pid\npgpool_socket_dir: /var/run/postgresql\npgpool_pcp_socket_dir: /var/run/postgresql\npgpool_wd_ipc_socket_dir: /var/run/postgresql\n```\n\nMore details at : https://www.pgpool.net/docs/latest/en/html/pcp-commands.html \n\nLicense\n-------\n\nMIT / BSD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffidanf%2Fansible-role-pgpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffidanf%2Fansible-role-pgpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffidanf%2Fansible-role-pgpool/lists"}