From 6c19ad58f53ba6071a84239e9a2ae148cae07f92 Mon Sep 17 00:00:00 2001 From: mayabi Date: Tue, 23 Apr 2024 16:44:53 +0330 Subject: [PATCH 1/2] define postgresql_privs due to priv deprecated in postgresql_user module --- roles/zabbix_proxy/tasks/postgresql.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/roles/zabbix_proxy/tasks/postgresql.yml b/roles/zabbix_proxy/tasks/postgresql.yml index e71af9aba..67b9c1a8d 100644 --- a/roles/zabbix_proxy/tasks/postgresql.yml +++ b/roles/zabbix_proxy/tasks/postgresql.yml @@ -31,9 +31,18 @@ name: "{{ zabbix_proxy_dbuser }}" password: "{{ ('md5' + (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5')) if zabbix_proxy_dbpassword_hash_method == 'md5' else zabbix_proxy_dbpassword }}" port: "{{ zabbix_proxy_dbport }}" - priv: ALL state: present encrypted: true + + - name: PostgreSQL | Delegated | GRANT ALL PRIVILEGES ON SCHEMA public TO {{ zabbix_proxy_dbuser }} + community.postgresql.postgresql_privs: + db: "{{ zabbix_proxy_dbname }}" + role: "{{ zabbix_proxy_dbuser }}" + privs: ALL + type: schema + objs: public + state: present + port: "{{ zabbix_proxy_dbport }}" become: true become_user: postgres delegate_to: "{{ delegated_dbhost }}" @@ -66,6 +75,17 @@ priv: ALL state: present encrypted: true + - name: PostgreSQL | Remote | GRANT ALL PRIVILEGES ON SCHEMA public TO {{ zabbix_proxy_dbuser }} + community.postgresql.postgresql_privs: + login_host: "{{ zabbix_proxy_pgsql_login_host | default(omit) }}" + login_user: "{{ zabbix_proxy_pgsql_login_user | default(omit) }}" + login_password: "{{ zabbix_proxy_pgsql_login_password | default(omit) }}" + db: "{{ zabbix_proxy_dbname }}" + role: "{{ zabbix_proxy_dbuser }}" + type: schema + objs: public + state: present + port: "{{ zabbix_proxy_dbport }}" when: - zabbix_proxy_database_creation - zabbix_proxy_pgsql_login_host is defined From 4db3f3197b07e006c9304ad16fc6299339cbf0c0 Mon Sep 17 00:00:00 2001 From: mayabi Date: Tue, 23 Apr 2024 16:48:48 +0330 Subject: [PATCH 2/2] define postgresql_privs due to priv deprecated in postgresql_user module --- roles/zabbix_proxy/tasks/postgresql.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/zabbix_proxy/tasks/postgresql.yml b/roles/zabbix_proxy/tasks/postgresql.yml index 67b9c1a8d..2fe436380 100644 --- a/roles/zabbix_proxy/tasks/postgresql.yml +++ b/roles/zabbix_proxy/tasks/postgresql.yml @@ -72,7 +72,6 @@ name: "{{ zabbix_proxy_dbuser }}" password: "{{ ('md5' + (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5')) if zabbix_proxy_dbpassword_hash_method == 'md5' else zabbix_proxy_dbpassword }}" port: "{{ zabbix_proxy_dbport }}" - priv: ALL state: present encrypted: true - name: PostgreSQL | Remote | GRANT ALL PRIVILEGES ON SCHEMA public TO {{ zabbix_proxy_dbuser }}