{"id":25931042,"url":"https://github.com/tom-sato/ansible-pg_rex","last_synced_at":"2026-05-07T22:42:22.331Z","repository":{"id":280151700,"uuid":"937211242","full_name":"tom-sato/ansible-pg_rex","owner":"tom-sato","description":"Ansible playbook that set up a PostgreSQL cluster with Pacemaker based on the PG-REX standard.","archived":false,"fork":false,"pushed_at":"2025-04-24T23:35:15.000Z","size":656,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-03T16:23:41.818Z","etag":null,"topics":["ansible","pacemaker","pg-rex","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tom-sato.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-22T15:48:59.000Z","updated_at":"2025-04-24T23:35:18.000Z","dependencies_parsed_at":"2025-03-01T16:23:24.168Z","dependency_job_id":"2b20b4e7-a4ed-45df-8adc-8dc843857ae9","html_url":"https://github.com/tom-sato/ansible-pg_rex","commit_stats":null,"previous_names":["tom-sato/ansible-pg_rex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tom-sato/ansible-pg_rex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-sato%2Fansible-pg_rex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-sato%2Fansible-pg_rex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-sato%2Fansible-pg_rex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-sato%2Fansible-pg_rex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tom-sato","download_url":"https://codeload.github.com/tom-sato/ansible-pg_rex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-sato%2Fansible-pg_rex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32759448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ansible","pacemaker","pg-rex","postgresql"],"created_at":"2025-03-03T23:57:10.333Z","updated_at":"2026-05-07T22:42:22.325Z","avatar_url":"https://github.com/tom-sato.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"Ansible Playbook for PG-REX\n===========================\n\nAnsible playbook that set up a PostgreSQL cluster with Pacemaker based on the PG-REX standard.\n\n![System Architecture](./img/system_architecture.png)\n\nRequirements\n------------\n\nThe playbook is tested with the following software versions:\n\n* VirtualBox 7.1.x\n* Vagrant 2.4.x\n* Vagrant box\n  * [rockylinux/8](https://app.vagrantup.com/rockylinux/boxes/8)\n  * [rockylinux/9](https://app.vagrantup.com/rockylinux/boxes/9)\n* Ansible 2.16.x\n* PG-REX 12 - 17\n  * PostgreSQL 12.x - 17.x\n  * Pacemaker 2.1.x\n  * Pacemaker Extra Tools ([pm\\_extra\\_tools](https://github.com/linux-ha-japan/pm_extra_tools)) 1.6\n  * PG-REX Operation Tools ([PG-REX-tools](https://github.com/ossc-db/PG-REX-tools)) 15.1 on EL8, 17.0 on EL9\n* VirtualBMC VirtualBox-ported edition ([virtualbmc-vbox](https://github.com/kskmori/virtualbmc-vbox)) devel2.0\n\nUsage\n-----\n\nTo run the playbook:\n\n```ShellSession\n$ git clone https://github.com/tom-sato/ansible-pg_rex.git\n$ cd ansible-pg_rex\n$ vagrant up --provision\n(snip)\nPLAY RECAP *********************************************************************\nnode-1                     : ok=61   changed=46   unreachable=0    failed=0    skipped=0    rescued=0    ignored=0\nnode-2                     : ok=37   changed=27   unreachable=0    failed=0    skipped=16   rescued=0    ignored=0\n\n$ ansible-playbook virtualbmc-start.yml\nUsing /home/tom-sato/work/ansible-pg_rex/ansible.cfg as config file\nbecome password: (Enter your password)\n(snip)\nPLAY RECAP *********************************************************************\nlocalhost                  : ok=9    changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0\n\n$ vagrant ssh node-1\n$ LANG=C sudo /usr/local/bin/pg-rex_primary_start pm_pcsgen_env.xml\n(snip)\nPrimary has started on the node (node-1).\n$ exit\n$ vagrant ssh node-2\n$ LANG=C sudo /usr/local/bin/pg-rex_standby_start\n(snip)\n4.3 Checking if it is ready to run pg_basebackup\n...[OK]\n\nFollowing methods are available to start this node as standby\nb) Start from a new base backup\nq) quit\nMake a choice among the options (b/q) b (Type \"b\" to continue)\n(snip)\nStandby has started on the node (node-2).\n$ sudo pcs status\nCluster name: pgrex_cluster\nCluster Summary:\n  * Stack: corosync (Pacemaker is running)\n  * Current DC: node-1 (version 2.1.8-3.el9-3980678f0) - partition with quorum\n  * Last updated: Sun Feb 23 00:41:41 2025 on node-2\n  * Last change:  Sun Feb 23 00:41:02 2025 by root via root on node-1\n  * 2 nodes configured\n  * 11 resource instances configured\n\nNode List:\n  * Online: [ node-1 node-2 ]\n\nFull List of Resources:\n  * Clone Set: pgsql-clone [pgsql] (promotable):\n    * Promoted: [ node-1 ]\n    * Unpromoted: [ node-2 ]\n  * Resource Group: primary-group:\n    * ipaddr-primary    (ocf:heartbeat:IPaddr2):         Started node-1\n    * ipaddr-replication        (ocf:heartbeat:IPaddr2):         Started node-1\n  * ipaddr-standby      (ocf:heartbeat:IPaddr2):         Started node-2\n  * Clone Set: ping-clone [ping]:\n    * Started: [ node-1 node-2 ]\n  * Clone Set: storage-mon-clone [storage-mon]:\n    * Started: [ node-1 node-2 ]\n  * fence1-ipmilan      (stonith:fence_ipmilan):         Started node-2\n  * fence2-ipmilan      (stonith:fence_ipmilan):         Started node-1\n\nDaemon Status:\n  corosync: active/disabled\n  pacemaker: active/disabled\n  pcsd: active/enabled\n```\n\nPlaybooks\n---------\n\nThe following playbooks are available:\n\n* `setup.yml` - Set up a PostgreSQL cluster with Pacemaker based on the PG-REX standard.\n* `virtualbmc-start.yml` - Starts the VirtualBMC server.\n* `virtualbmc-stop.yml` - Stops the VirtualBMC Server.\n\nVariables\n---------\n\nThe following variables are available in the `./group_vars/all.yml` file:\n\n* `s_lan_interface` - Specifies the interface name for the service provision network \"S-LAN\". The default is `eth1`.\n* `d_lan_interface` - Specifies the interface name for the interconnect communication network \"IC-LAN\". The default is `eth2`.\n* `ic_lan_interfaces` - Specifies a list of interface names for the data transfer network \"D-LAN\". The default is `[eth3, eth4]`.\n* `a_lan_interface` - Specifies the interface name for the administration network \"Administration LAN\". The default is `eth5`.\n* `system_locale` - Specifies the system locale. The default is `ja_JP.UTF-8`.\n* `system_timezone` - Specifies the system time zone. The default is `Asia/Tokyo`.\n* `pacemaker_password` - Specifies the password for the `hacluster` user. The default is `hapasswd`.\n* `pacemaker_cluster_name` - Specifies the cluster name. The default is `pgrex_cluster`.\n* `postgresql_version` - Specifies the PostgreSQL version. The default is `16`.\n* `postgresql_password` - Specifies the password for the `postgres` user. The default is `pgpasswd`.\n* `postgresql_data_directory` - Specifies the data directory path. The default is `/dbfp/pgdata/data`.\n* `postgresql_wal_directory` - Specifies the WAL directory path. The default is `/dbfp/pgwal/pg_wal`.\n* `postgresql_archive_directory` - Specifies the archive directory path. The default is `/dbfp/pgarch/arc1`.\n* `postgresql_port` - Specifies the port number for PostgreSQL server. The default is `5432`.\n* `postgresql_replication_user` - Specifies the username for replication connection. The default is `repuser`.\n* `postgresql_replication_password` - Specifies the password for the replication user. The default is `reppasswd`.\n* `postgresql_replication_address` - Specifies the virtual IP address for the replication connection. The default is `192.168.59.111`.\n* `postgresql_primary_address` - Specifies the virtual IP address for the primary connection. The default is `192.168.56.111`.\n* `postgresql_standby_address` - Specifies the virtual IP address for the standby connection. The default is `192.168.56.112`.\n* `monitored_addresses` - Specifies the IP addresses to be monitored for health checks. The default is the server's default gateway IP address.\n* `monitored_devices` - Specifies the storage devices to be monitored for health checks. The default is all storage devices on the server.\n* `ipmi_addresses` - Specifies a hash of the IP address for IPMI connection keyed by the hostname. The default is `{node-1: 172.23.135.101, node-2: 172.23.135.102}`.\n* `ipmi_user` - Specifies the username for IPMI connection. The default is `Administrator`.\n* `ipmi_password` - Specifies the password for the IPMI user. The default is `adminpasswd`.\n* `pm_extra_tools_download_urls`- Specifies a hash of the Pacemaker Extra Tools download URL keyed by the major version of the distribution.\n* `pg_rex_tools_download_urls`- Specifies a hash of the PG-REX Operation Tools download URL keyed by the major version of the distribution.\n\nLicense\n-------\n\nBSD\n\nAuthor Information\n------------------\n\nTomoaki Sato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-sato%2Fansible-pg_rex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftom-sato%2Fansible-pg_rex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-sato%2Fansible-pg_rex/lists"}