{"id":19269518,"url":"https://github.com/status-im/infra-role-postgres-ha","last_synced_at":"2026-03-07T02:32:32.730Z","repository":{"id":63732112,"uuid":"570286794","full_name":"status-im/infra-role-postgres-ha","owner":"status-im","description":"Ansible role for deploying High Availability PostgreSQL","archived":false,"fork":false,"pushed_at":"2026-03-02T08:41:07.000Z","size":115,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":37,"default_branch":"master","last_synced_at":"2026-03-02T12:37:04.676Z","etag":null,"topics":["ansible-role","infra"],"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/status-im.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":"2022-11-24T19:48:55.000Z","updated_at":"2026-03-02T08:41:11.000Z","dependencies_parsed_at":"2023-11-21T16:43:07.879Z","dependency_job_id":"374a0d6d-9ac9-4018-9617-74f8ea62dec0","html_url":"https://github.com/status-im/infra-role-postgres-ha","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/status-im/infra-role-postgres-ha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/status-im%2Finfra-role-postgres-ha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/status-im%2Finfra-role-postgres-ha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/status-im%2Finfra-role-postgres-ha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/status-im%2Finfra-role-postgres-ha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/status-im","download_url":"https://codeload.github.com/status-im/infra-role-postgres-ha/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/status-im%2Finfra-role-postgres-ha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30206067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"online","status_checked_at":"2026-03-07T02:00:06.765Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["ansible-role","infra"],"created_at":"2024-11-09T20:20:17.274Z","updated_at":"2026-03-07T02:32:32.704Z","avatar_url":"https://github.com/status-im.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nThis role configures a High-Availability [PostgreSQL](https://www.postgresql.org/) Database with replication from master to slaves.\n\n# Configuration\n\nTo run just one instance without actual High-Availability use:\n```yaml\npostgres_ha_db_name: 'example-db'\npostgres_ha_admin_user: 'admin'\npostgres_ha_admin_pass: 'super-secret-password'\n```\nFor replicaton other settings\n```yaml\npostgres_ha_is_master: '{{ hostname == \"node-01.example.org\" }}'\npostgres_ha_replica_host: 'node-01.example.org'\npostgres_ha_replica_port: 5043\npostgres_ha_replica_allowed_addresses: ['11.12.13.15']\n```\nYou can create additional databases using:\n```yaml\n# Databases to init\npostgres_ha_databases:\n  - name: my-db\n    user: my-user\n    pass: my-pass\n    script: 'CREATE SCHEMA IF NOT EXIST example;'\n\n  - name: my-other-db\n    user: my-other-user\n    pass: my-other-pass\n```\nThe `user` field is optional. DB name is used by default.\nThe field `script` is optional and allow to add commands to run when creating the database.\n\nAdditional users can be defined using:\n```yaml\npostgres_ha_users:\n  - name: 'devops'\n    pass: 'hunter2'\n    db:   'my-db'\n    priv: 'ALL PRIVILEGES'\n\n  - name: 'security'\n    pass: 'hunter3'\n    db:   'my-db'\n    priv: 'pg_read_all_data'\n```\n\nAdditionaly, an init script can be run on the main database:\n```yaml\npostgres_ha_init_script: 'CREATE TABLE example (example TEXT);'\n```\n\nBackup settings can be adjusted using:\n```yaml\npostgres_ha_backup: false\npostgres_ha_backup_frequency: 'weekly'\npostgres_ha_backup_timeout: 1200\n```\n\nAnd database settings can be modified using the [`ALTER SYSTEM`](https://www.postgresql.org/docs/current/sql-altersystem.html) configuration:\n```yaml\npostgres_ha_alter_system_settings:\n  checkpoint_timeout: '5min'\n  max_wal_size: '1GB'\n  min_wal_size: '80MB'\n```\n\nContainer share memory can be configured with:\n```yaml\npostgres_ha_share_memory: '1g'\n```\n\nMetrics exporter for query performance can be activated with:\n```yaml\npostgres_ha_perf_metrics_exporter_disabled: false\n```\n\n# Management\n\nThe service is managed using [Docker Compose](https://docs.docker.com/compose/):\n```sh\nadmin@node-01.example.org:/docker/postgres-ha % docker-compose ps\n   Name                 Command                 State                    Ports\n--------------------------------------------------------------------------------------------\npostgres-ha   docker-entrypoint.sh -p 5433   Up (healthy)   5432/tcp, 0.0.0.0:5433-\u003e5433/tcp\npg-metrics-exporter   /bin/postgres_exporter         Up             0.0.0.0:9187-\u003e9187/tcp\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatus-im%2Finfra-role-postgres-ha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatus-im%2Finfra-role-postgres-ha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatus-im%2Finfra-role-postgres-ha/lists"}