diff --git a/zabbix/defaults.yaml b/zabbix/defaults.yaml index 4e553c8..e2d87d8 100644 --- a/zabbix/defaults.yaml +++ b/zabbix/defaults.yaml @@ -77,3 +77,4 @@ zabbix: dbname: zabbix dbuser: zabbix dbpassword: zabbix + sql_file: /usr/share/doc/zabbix-server-pgsql/create.sql.gz diff --git a/zabbix/osfamilymap.yaml b/zabbix/osfamilymap.yaml index d4a3439..ff64daf 100644 --- a/zabbix/osfamilymap.yaml +++ b/zabbix/osfamilymap.yaml @@ -167,6 +167,7 @@ Suse: pgsql: pkgs: - postgresql + - gzip sql_file: /usr/share/doc/packages/zabbix-server-pgsql/create.sql.gz diff --git a/zabbix/pgsql/schema.sls b/zabbix/pgsql/schema.sls index 967d45a..9fa4a40 100644 --- a/zabbix/pgsql/schema.sls +++ b/zabbix/pgsql/schema.sls @@ -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 = {} -%} @@ -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 }}