{"id":24297785,"url":"https://github.com/ibarwick/pglogical_demo_ansible","last_synced_at":"2026-03-08T07:32:40.979Z","repository":{"id":70372168,"uuid":"84520099","full_name":"ibarwick/pglogical_demo_ansible","owner":"ibarwick","description":"Create a simple PostgreSQL pglogical setup using Ansible","archived":false,"fork":false,"pushed_at":"2017-06-20T00:24:39.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T08:57:54.496Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibarwick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-03-10T04:44:30.000Z","updated_at":"2017-03-27T19:44:12.000Z","dependencies_parsed_at":"2023-02-24T15:45:12.924Z","dependency_job_id":null,"html_url":"https://github.com/ibarwick/pglogical_demo_ansible","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ibarwick/pglogical_demo_ansible","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibarwick%2Fpglogical_demo_ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibarwick%2Fpglogical_demo_ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibarwick%2Fpglogical_demo_ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibarwick%2Fpglogical_demo_ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibarwick","download_url":"https://codeload.github.com/ibarwick/pglogical_demo_ansible/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibarwick%2Fpglogical_demo_ansible/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30248922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T05:41:50.788Z","status":"ssl_error","status_checked_at":"2026-03-08T05:41:39.075Z","response_time":56,"last_error":"SSL_read: 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":[],"created_at":"2025-01-16T20:29:26.783Z","updated_at":"2026-03-08T07:32:40.974Z","avatar_url":"https://github.com/ibarwick.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"pglogical_demo_ansible\n======================\n\nThis repository contains a set of Ansible playbooks to easily\ncreate a simple `pglogical` set-up with two or more nodes running\non different ports on localhost.\n\nFor more details on 2ndQuadrant's `pglogical`, see:\n\n  http://2ndquadrant.com/en/resources/pglogical/\n\n\nRequirements\n------------\n\n- Ansible ( http://www.ansible.com/ )\n- psycopg2\n- PostgreSQL 9.5 or 9.6 with the pglogical extension(s) available\n  Note: `pglogical_demo_ansible` will not build the pglogical extensions(s);\n  see https://2ndquadrant.com/en/resources/pglogical/pglogical-docs/ for details\n  on how to do this.\n\n\npglogical Configuration\n-----------------------\n\nCreate a file `your_hostname.yml` in the `host_vars` directory\nwith the following variables (default values in parentheses)\n\n- `db_superuser` (`postgres`)\n- `db_name` (`pgl_demo`)\n- `pg_bin`: path to the pglogical-enabled PostgreSQL `bin/` directory\n- `base_data_dir`: arbitrary directory for each instance's data files\n- `base_log_dir` (`/tmp`): directory for PostgreSQL log files\n- `pgl_ports`: list of ports for PostgreSQL instances\n- `pgl_provider`: port number of the initial PostgreSQL instance,\n  from which the other instances will subscribe from (usually just\n  the first entry in `pgl_ports`).\n\nAdd `your_hostname` to the `[hosts]` section of `hosts.ini`\n\nThe file `host_vars/sample_host.yml` provides a useful template containing the\nparameters which will probably need to be configured.\n\nMacPorts users: if Ansible complains about `psycopg2` being missing, it is\nprobably using the OS X native Python interpreter; set `ansible_python_interpreter`\nto point to the MacPorts version.\n\n\nCreate a pglogical cluster\n--------------------------\n\n    $ ansible-playbook -i hosts.ini pgl_init.yml\n\n    PLAY [all] *********************************************************************\n\n    TASK [pgl_init : Create data directories] **************************************\n    changed: [osaka] =\u003e (item=10001)\n    changed: [osaka] =\u003e (item=10002)\n    changed: [osaka] =\u003e (item=10003)\n\n    TASK [pgl_init : Perform initdb] ***********************************************\n    changed: [osaka] =\u003e (item=10001)\n    changed: [osaka] =\u003e (item=10002)\n    changed: [osaka] =\u003e (item=10003)\n\n    (...)\n\n    TASK [pgl_init : Create required extensions] ***********************************\n    changed: [osaka] =\u003e (item=[10001, u'pglogical'])\n    changed: [osaka] =\u003e (item=[10002, u'pglogical'])\n    changed: [osaka] =\u003e (item=[10003, u'pglogical'])\n\n    TASK [pgl_init : Create required extensions (9.4 only)] ************************\n    skipping: [osaka] =\u003e (item=[10001, u'pglogical_origin'])\n    skipping: [osaka] =\u003e (item=[10002, u'pglogical_origin'])\n    skipping: [osaka] =\u003e (item=[10003, u'pglogical_origin'])\n\n    TASK [pgl_init : Generate SQL to create provider node] *************************\n    ok: [osaka]\n\n    TASK [pgl_init : Generate SQL to create subscriber node] ***********************\n    skipping: [osaka] =\u003e (item=10001)\n    ok: [osaka] =\u003e (item=10002)\n    ok: [osaka] =\u003e (item=10003)\n\n    TASK [pgl_init : Create provider node] *****************************************\n    changed: [osaka]\n\n    TASK [pgl_init : Create subscriber nodes] **************************************\n    skipping: [osaka] =\u003e (item=10001)\n    changed: [osaka] =\u003e (item=10002)\n    changed: [osaka] =\u003e (item=10003)\n\n    PLAY RECAP *********************************************************************\n    osaka                      : ok=15   changed=13   unreachable=0    failed=0\n\nA test table `pgl_demo` has been pre-created by the scripts; insert a row on\nthe provider and it will appear on the subscriber(s):\n\n    $ psql -U postgres -d pgl_demo -h localhost -p 10001\n    psql (9.6.2)\n    Type \"help\" for help.\n\n    pgl_demo=# INSERT INTO pgl_test values(1,'foo');\n    INSERT 0 1\n    Time: 5.239 ms\n    pgl_demo=# \\q\n\n    $ psql -U postgres -d pgl_demo -h localhost -p 10002\n    psql (9.6.2)\n    Type \"help\" for help.\n\n    pgl_demo=# SELECT * FROM pgl_test ;\n     id | val\n    ----+-----\n      1 | foo\n    (1 row)\n\n    Time: 0.755 ms\n\nPlaybooks\n---------\n\nFollowing playbooks have been defined:\n\n- `pgl_init.yml`\n\n  Creates and configures pglogical nodes\n\n- `pgl_destroy.yml`\n\n  Halts existing pglogical nodes and removes the database directories\n\n- `pgl_start.yml`\n\n  Starts previously configured but not running pglogical nodes\n\n- `pgl_stop.yml`\n\n  Stops running pglogical nodes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibarwick%2Fpglogical_demo_ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibarwick%2Fpglogical_demo_ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibarwick%2Fpglogical_demo_ansible/lists"}