geerlingguy / ansible-role-postgresql

Ansible Role - PostgreSQL
https://galaxy.ansible.com/geerlingguy/postgresql/
MIT License
567 stars 386 forks source link

Would support for namimg / multiple instances be accepted? #241

Closed jantari closed 1 year ago

jantari commented 1 year ago

We have a usecase for multiple clusters/instances of PostgreSQL on one server.

Basically an app needs dbcreator permissions, so we need to isolate it from our "main" cluster so it cannot overwrite other production databases with that permission.

This should be fairly easy by just variable-izing the "main" default cluster name. A PR has existed for this before but was closed by the author: https://github.com/geerlingguy/ansible-role-postgresql/pull/70

I would create a new PR to implement this but want to know first whether it would be accepted.

Currently this role is hardcoded to always manage the PostgreSQL instance called "main". That's limiting, the idea is that the role could be run in a loop to configure multiple instances:

- hosts: database
  gather_facts: yes
  roles:
    - role: geerlingguy.postgresql
      become: yes
      vars:
        # postgresql_cluster unset, defaults to "main"
        postgresql_databases:
          - name: exampledb 
    - role: geerlingguy.postgresql
      become: yes
      vars:
        postgresql_cluster: whatever
        postgresql_databases:
          - name: exampledb2
github-actions[bot] commented 1 year ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] commented 1 year ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.