From 2ce8906f5fd92e39c6eaa7485393af603b120a23 Mon Sep 17 00:00:00 2001 From: David Kirwan Date: Tue, 13 Jun 2023 08:09:30 +0100 Subject: [PATCH] zabbix: formatting issue in zabbix web config template rework db task for creating zabbix user Signed-off-by: David Kirwan --- roles/zabbix/zabbix_server/tasks/db.yml | 16 ++++++---------- .../zabbix_server/templates/zabbix.conf.php.j2 | 14 +++++++------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/roles/zabbix/zabbix_server/tasks/db.yml b/roles/zabbix/zabbix_server/tasks/db.yml index 785ea038fb..553e31cf04 100644 --- a/roles/zabbix/zabbix_server/tasks/db.yml +++ b/roles/zabbix/zabbix_server/tasks/db.yml @@ -16,17 +16,13 @@ tags: - zabbix-services -- name: Configure the zabbix db user - ansible.builtin.shell: | - sudo -u postgres createuser --pwprompt {{ zabbix_db_user }} - expect "Enter password for new role: " - send "{{ zabbix_db_pass }}\n" - expect "Enter it again: " - send "{{ zabbix_db_pass }}\n" - - exit 0 -# no_log: True +- name: Connect to acme database, create django user, and grant access to database and products table + postgresql_user: + name: "{{ zabbix_db_user }}" + password: "{{ zabbix_db_pass }}" + become: true + become_user: postgres tags: - db-configure diff --git a/roles/zabbix/zabbix_server/templates/zabbix.conf.php.j2 b/roles/zabbix/zabbix_server/templates/zabbix.conf.php.j2 index 5ee5d0b5a7..a1a2abc7ed 100644 --- a/roles/zabbix/zabbix_server/templates/zabbix.conf.php.j2 +++ b/roles/zabbix/zabbix_server/templates/zabbix.conf.php.j2 @@ -1,12 +1,12 @@ -