Skip to content

Commit

Permalink
fix(pgsql): fix pgsql import - guaranteed user, don't end psql too soon
Browse files Browse the repository at this point in the history
  • Loading branch information
ghormoon committed Apr 16, 2021
1 parent 5c81ca1 commit 224b87c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zabbix/pgsql/schema.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit 224b87c

Please sign in to comment.