diff --git a/zabbix/pgsql/schema.sls b/zabbix/pgsql/schema.sls index 9b148867..42cee1a1 100644 --- a/zabbix/pgsql/schema.sls +++ b/zabbix/pgsql/schema.sls @@ -16,7 +16,7 @@ # Connection args required only if dbroot_user and dbroot_pass defined. {% set connection_args = {} -%} {% if dbroot_user and dbroot_pass -%} -{% set connection_args = {'runas': 'nobody', 'host': dbhost, 'user': dbroot_user, 'password': dbroot_pass} -%} +{% set connection_args = {'runas': zabbix.user, 'host': dbhost, 'user': dbroot_user, 'password': dbroot_pass} -%} {% endif -%} # Check is there any tables in database. @@ -51,7 +51,7 @@ upload_sql_dump: import_sql: cmd.run: - - name: zcat {{ sql_file }} | psql | head -5 + - name: zcat {{ sql_file }} | psql | { head -5; cat >/dev/null; } - runas: {{ zabbix.user }} - env: - PGUSER: {{ dbuser }}