{"id":18781553,"url":"https://github.com/devture/com.devture.ansible.role.postgres","last_synced_at":"2025-04-13T12:32:50.118Z","repository":{"id":75996720,"uuid":"555253862","full_name":"devture/com.devture.ansible.role.postgres","owner":"devture","description":"An Ansible role which installs Postgres to run as a Docker container wrapped in a systemd service","archived":false,"fork":false,"pushed_at":"2024-06-04T08:37:06.000Z","size":77,"stargazers_count":3,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-04T09:56:07.688Z","etag":null,"topics":["ansible-role","docker","postgres"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devture.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}},"created_at":"2022-10-21T08:16:07.000Z","updated_at":"2024-06-04T08:37:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"34543c40-fd10-46e1-b764-93fa41cc06b8","html_url":"https://github.com/devture/com.devture.ansible.role.postgres","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devture%2Fcom.devture.ansible.role.postgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devture%2Fcom.devture.ansible.role.postgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devture%2Fcom.devture.ansible.role.postgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devture%2Fcom.devture.ansible.role.postgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devture","download_url":"https://codeload.github.com/devture/com.devture.ansible.role.postgres/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223585784,"owners_count":17169368,"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","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","docker","postgres"],"created_at":"2024-11-07T20:32:30.552Z","updated_at":"2024-11-07T20:32:31.205Z","avatar_url":"https://github.com/devture.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postgres Ansible role\n\n⚠️ **WARNING**: this role is now maintained in [mother-of-all-self-hosting/ansible-role-postgres](https://github.com/mother-of-all-self-hosting/ansible-role-postgres).\n\nThis is an [Ansible](https://www.ansible.com/) role which installs [Postgres](https://www.postgresql.org/) to run as a [Docker](https://www.docker.com/) container wrapped in a systemd service.\n\nThis role *implicitly* depends on:\n\n- [`com.devture.ansible.role.playbook_help`](https://github.com/devture/com.devture.ansible.role.playbook_help)\n- [`com.devture.ansible.role.systemd_docker_base`](https://github.com/devture/com.devture.ansible.role.systemd_docker_base)\n\n\n## Features\n\n- **multiple databases support**: this role manages one main database and root credentials, and optionally a list of additional managed databases with their own credentials (see `devture_postgres_managed_databases`)\n\n- **backward compatible**: even if a new Postgres version is available, the role will keep you on the Postgres version you had started with until you perform a major upgrade manually (see below)\n\n- **upgrading between major Postgres versions**: invoking the playbook with a `--tags=upgrade-postgres` performs a dump, data move (`data` -\u003e `data-auto-upgrade-backup`), rebuild, and dump import\n\n- **importing existing Postgres database dumps**: you can import plain-text (`.sql`) or gzipped (`sql.gz`) dumps with the `--tags=import-postgres` tag\n\n- **import data from SQLite, NeDB, etc**: this is an internal task (not exposed as a playbook tag), but the role supports using [pgloader](https://pgloader.io/) to load data into Postgres\n\n- **vacuum support**: you can vacuum the database using the `--tags=run-postgres-vacuum` tag\n\n- **helpful scripts**:\n  - get a `psql` interactive terminal via the `/base_path/bin/cli` and `/base_path/bin/cli-non-interactive` scripts\n  - dump all databases using the `/base_path/bin/dump-all DIRECTORY_PATH` (which will dump to a `latest-dump.sql.gz` file there)\n\n## Usage\n\nExample playbook:\n\n```yaml\n- hosts: servers\n  roles:\n    - role: galaxy/com.devture.ansible.role.systemd_docker_base\n\n    - role: galaxy/com.devture.ansible.role.postgres\n\n    - role: another_role\n```\n\nExample playbook configuration (`group_vars/servers` or other):\n\n```yaml\ndevture_postgres_identifier: my-postgres\n\ndevture_postgres_base_path: \"{{ my_base_path }}/postgres\"\n\ndevture_postgres_container_network: \"{{ my_container_container_network }}\"\n\ndevture_postgres_uid: \"{{ my_uid }}\"\ndevture_postgres_gid: \"{{ my_gid }}\"\n\ndevture_postgres_vacuum_default_databases_list: [\"mydb\", \"anotherdb\"]\n\ndevture_postgres_systemd_services_to_stop_for_maintenance_list: |\n  {{\n    (['my-service.service'])\n  }}\n\ndevture_postgres_managed_databases: |\n  {{\n    [{\n      'name': my_database_name,\n      'username': my_database_username,\n      'password': my_database_password,\n    }]\n    +\n    [{\n      'name': another_database_name,\n      'username': another_database_username,\n      'password': another_database_password,\n    }]\n  }}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevture%2Fcom.devture.ansible.role.postgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevture%2Fcom.devture.ansible.role.postgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevture%2Fcom.devture.ansible.role.postgres/lists"}