Fix and set useful backup extension for postgresql.conf file

This commit is contained in:
Denys Havrysh
2016-12-19 12:29:14 +02:00
parent 663db90006
commit a291d40ef1
2 changed files with 34 additions and 25 deletions

View File

@@ -14,6 +14,16 @@ postgres:
- postgresql-contrib
- postgresql-plpython
# This section will append your configuration to postgresql.conf.
postgresconf: |
listen_addresses = 'localhost,*'
# Backup extension for postgresql.conf file, defaults to `.bak`.
# Set to False to stop creation of backup on postgresql.conf changes.
{%- if 'status.time' in salt.keys() %}
postgresconf_backup: ".backup@{{ salt['status.time']('%y-%m-%d_%H:%M:%S') }}"
{%- endif %}
# Path to the `pg_hba.conf` file Jinja template on Salt Fileserver
pg_hba.conf: salt://postgres/templates/pg_hba.conf.j2
@@ -87,11 +97,13 @@ postgres:
absentUser:
ensure: absent
# tablespaces to be created
tablespaces:
my_space:
directory: /srv/my_tablespace
owner: localUser
# databases to be created
databases:
db1:
owner: 'localUser'
@@ -118,11 +130,4 @@ postgres:
maintenance_db: db1
#postgis: {}
# Backup extension defaults to .bak if postgresconf_backup is True.
# Set to False to stop creation of backup on postgresql.conf changes.
postgresconf_backup: True
# This section will append your configuration to postgresql.conf.
postgresconf: |
listen_addresses = 'localhost,*'
# vim: ft=yaml:sw=2
# vim: ft=yaml ts=2 sts=2 sw=2 et