Skip to content

Commit

Permalink
fix(pgsql): fix pgsql import - pgsql fixes, defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
ghormoon committed May 11, 2021
1 parent 078ffdb commit fbff3c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions zabbix/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ zabbix:
dbname: zabbix
dbuser: zabbix
dbpassword: zabbix
sql_file: /usr/share/doc/zabbix-server-pgsql/create.sql.gz
1 change: 1 addition & 0 deletions zabbix/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Suse:
pgsql:
pkgs:
- postgresql
- gzip
sql_file: /usr/share/doc/packages/zabbix-server-pgsql/create.sql.gz


Expand Down
4 changes: 2 additions & 2 deletions zabbix/pgsql/schema.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% set dbroot_user = settings.get('dbroot_user') -%}
{% set dbroot_pass = settings.get('dbroot_pass') -%}
{% set sql_file = settings.get('sql_file', '/usr/share/doc/zabbix-server-pgsql/create.sql.gz') -%}
{% set sql_file = settings.get('sql_file', defaults.sql_file) -%}
# Connection args required only if dbroot_user and dbroot_pass defined.
{% set connection_args = {} -%}
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 fbff3c1

Please sign in to comment.