Skip to content

Commit 224b87c

Browse files
committed
fix(pgsql): fix pgsql import - guaranteed user, don't end psql too soon
1 parent 5c81ca1 commit 224b87c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zabbix/pgsql/schema.sls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Connection args required only if dbroot_user and dbroot_pass defined.
1717
{% set connection_args = {} -%}
1818
{% if dbroot_user and dbroot_pass -%}
19-
{% set connection_args = {'runas': 'nobody', 'host': dbhost, 'user': dbroot_user, 'password': dbroot_pass} -%}
19+
{% set connection_args = {'runas': zabbix.user, 'host': dbhost, 'user': dbroot_user, 'password': dbroot_pass} -%}
2020
{% endif -%}
2121
2222
# Check is there any tables in database.
@@ -51,7 +51,7 @@ upload_sql_dump:
5151
5252
import_sql:
5353
cmd.run:
54-
- name: zcat {{ sql_file }} | psql | head -5
54+
- name: zcat {{ sql_file }} | psql | { head -5; cat >/dev/null; }
5555
- runas: {{ zabbix.user }}
5656
- env:
5757
- PGUSER: {{ dbuser }}

0 commit comments

Comments
 (0)