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 @@ -