Adds PostgreSQL 15 support to koji_db_server role

master
Eugene Zamriy 11 months ago
parent 4ad5be8f39
commit 8b6840601f
Signed by: ezamriy
GPG Key ID: 7EBF95C7DCFA496C

@ -0,0 +1,3 @@
---
bugfixes:
- koji_db_server - added PostgreSQL 15 support by granting schema usage and create privileges to Koji user.

@ -35,6 +35,24 @@
become: true become: true
become_user: postgres become_user: postgres
- name: Get PostgreSQL server version
community.postgresql.postgresql_info:
filter: ver*
become: true
become_user: postgres
register: postgres_version
- name: GRANT USAGE, CREATE PRIVILEGES ON SCHEMA public TO koji_db_server_user
community.postgresql.postgresql_privs:
db: "{{ koji_db_server_db_name }}"
privs: USAGE,CREATE
type: schema
objs: public
role: "{{ koji_db_server_user }}"
become: true
become_user: postgres
when: postgres_version.version.major >= 15
- name: Allow requests from Koji server - name: Allow requests from Koji server
community.postgresql.postgresql_pg_hba: community.postgresql.postgresql_pg_hba:
dest: /var/lib/pgsql/data/pg_hba.conf dest: /var/lib/pgsql/data/pg_hba.conf
@ -43,4 +61,10 @@
users: "{{ koji_db_server_user }}" users: "{{ koji_db_server_user }}"
address: "{{ koji_db_server_ip }}/32" address: "{{ koji_db_server_ip }}/32"
method: "{{ koji_db_server_password_encryption }}" method: "{{ koji_db_server_password_encryption }}"
notify: restart postgresql register: pg_hba_status
- name: Restart PostgreSQL
ansible.builtin.service:
name: postgresql
state: restarted
when: pg_hba_status.changed

Loading…
Cancel
Save