Ansible collection for database-related roles https://galaxy.ansible.com/ui/repo/published/devxy/database/
Find a file
devxy-bot 8e7b866947
All checks were successful
ci/crow/push/changelog Pipeline was successful
ci/crow/push/lint Pipeline was successful
chore(deps): update pre-commit hook ansible-community/ansible-lint to v26.1.1
2026-01-17 00:33:09 +00:00
.crow chore(deps): update codeberg.org/crow-plugins/clone docker tag to v1.0.3 2026-01-16 00:33:03 +00:00
.gitsv init 2025-12-27 22:29:16 +01:00
ansibledoctor/templates/readme init 2025-12-27 22:29:16 +01:00
meta init 2025-12-27 22:29:16 +01:00
roles refactor: add 'docker' deployment mode for pgbackrest 2026-01-15 12:32:00 +01:00
.ansible-lint init 2025-12-27 22:29:16 +01:00
.ansibledoctor.yaml init 2025-12-27 22:29:16 +01:00
.editorconfig init 2025-12-27 22:29:16 +01:00
.editorconfig-checker.json init 2025-12-27 22:29:16 +01:00
.gitignore feat(postgres): use optimized defaults and account for maximum RAM of server 2026-01-14 22:43:33 +01:00
.markdownlint-cli2.yaml init 2025-12-27 22:29:16 +01:00
.markdownlint.yaml init 2025-12-27 22:29:16 +01:00
.pre-commit-config.yaml chore(deps): update pre-commit hook ansible-community/ansible-lint to v26.1.1 2026-01-17 00:33:09 +00:00
.yamllint.yaml init 2025-12-27 22:29:16 +01:00
commitlint.config.mjs init 2025-12-27 22:29:16 +01:00
galaxy.yml feat: add pgbouncer role 2026-01-14 23:13:59 +01:00
Justfile fix: strip ansible-doctor generator artifact from README 2025-12-28 11:02:09 +01:00
README.md feat: add pgbouncer role 2026-01-14 23:13:59 +01:00
renovate.json init 2025-12-27 22:29:16 +01:00

Ansible Collection "database"

status-badge

Ansible collection for deploying and managing PostgreSQL database infrastructure.

Roles

Role Description
postgres Deploy PostgreSQL with Docker using pgautoupgrade for automatic version upgrades
pgbouncer Deploy PgBouncer connection pooler with optimized defaults
pgbackrest Install and configure pgBackRest for PostgreSQL backup management

Installation

ansible-galaxy collection install devxy.database

Usage

requirements.yml:

collections:
  - name: devxy.database
    version: ">=0.1.0"

Deploy PostgreSQL with Connection Pooling

- name: Deploy database infrastructure
  hosts: database_servers
  roles:
    # Deploy PostgreSQL
    - role: devxy.database.postgres
      postgres_password: "{{ vault_postgres_password }}"
      postgres_databases:
        - name: myapp
          owner: myapp_user
      postgres_users:
        - name: myapp_user
          password: "{{ vault_myapp_password }}"
          database: myapp
          privileges: ALL
      postgres_networks:
        - name: database_net

    # Deploy PgBouncer for connection pooling
    - role: devxy.database.pgbouncer
      pgbouncer_databases:
        - name: myapp
          host: postgres
          port: 5432
      pgbouncer_users:
        - name: myapp_user
          password: "{{ vault_myapp_password }}"
      pgbouncer_networks:
        - name: database_net

Deploy PostgreSQL with Backup

- name: Deploy PostgreSQL with backup
  hosts: database_servers
  roles:
    - role: devxy.database.postgres
      postgres_password: "{{ vault_postgres_password }}"

    - role: devxy.database.pgbackrest
      pgbackrest_is_pg_host: true
      pgbackrest_stanza: main
      pgbackrest_repo_path: /var/lib/pgbackrest

Documentation

Refer to the README.md files within each individual role:

  • postgres - PostgreSQL deployment with auto-tuned settings
  • pgbouncer - Connection pooling with transaction mode
  • pgbackrest - Backup and restore management

Ansible Galaxy

License

AGPL-3.0-or-later