mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 09:40:26 +00:00
Merge pull request #135 from vutny/set-postgresql.conf-backup-extension
Fix and set useful backup extension for postgresql.conf file
This commit is contained in:
commit
80077169ce
2 changed files with 35 additions and 25 deletions
|
@ -14,6 +14,17 @@ postgres:
|
||||||
- postgresql-contrib
|
- postgresql-contrib
|
||||||
- postgresql-plpython
|
- postgresql-plpython
|
||||||
|
|
||||||
|
# Append the lines under this item to your postgresql.conf file.
|
||||||
|
# Pay attention to indent exactly with 4 spaces for all lines.
|
||||||
|
postgresconf: |
|
||||||
|
listen_addresses = '*' # listen on all interfaces
|
||||||
|
|
||||||
|
# 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
|
# Path to the `pg_hba.conf` file Jinja template on Salt Fileserver
|
||||||
pg_hba.conf: salt://postgres/templates/pg_hba.conf.j2
|
pg_hba.conf: salt://postgres/templates/pg_hba.conf.j2
|
||||||
|
|
||||||
|
@ -87,11 +98,13 @@ postgres:
|
||||||
absentUser:
|
absentUser:
|
||||||
ensure: absent
|
ensure: absent
|
||||||
|
|
||||||
|
# tablespaces to be created
|
||||||
tablespaces:
|
tablespaces:
|
||||||
my_space:
|
my_space:
|
||||||
directory: /srv/my_tablespace
|
directory: /srv/my_tablespace
|
||||||
owner: localUser
|
owner: localUser
|
||||||
|
|
||||||
|
# databases to be created
|
||||||
databases:
|
databases:
|
||||||
db1:
|
db1:
|
||||||
owner: 'localUser'
|
owner: 'localUser'
|
||||||
|
@ -118,11 +131,4 @@ postgres:
|
||||||
maintenance_db: db1
|
maintenance_db: db1
|
||||||
#postgis: {}
|
#postgis: {}
|
||||||
|
|
||||||
# Backup extension defaults to .bak if postgresconf_backup is True.
|
# vim: ft=yaml ts=2 sts=2 sw=2 et
|
||||||
# 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
|
|
||||||
|
|
|
@ -11,23 +11,6 @@ postgres:
|
||||||
python: python-psycopg2
|
python: python-psycopg2
|
||||||
user: postgres
|
user: postgres
|
||||||
group: postgres
|
group: postgres
|
||||||
conf_dir: /var/lib/pgsql/data
|
|
||||||
pg_hba.conf: salt://postgres/templates/pg_hba.conf.j2
|
|
||||||
acls:
|
|
||||||
# "local" is for Unix domain socket connections only
|
|
||||||
- ['local', 'all', 'all', 'peer']
|
|
||||||
# IPv4 local connections:
|
|
||||||
- ['host', 'all', 'all', '127.0.0.1/32', 'md5']
|
|
||||||
# IPv6 local connections:
|
|
||||||
- ['host', 'all', 'all', '::1/128', 'md5']
|
|
||||||
service: postgresql
|
|
||||||
users: {}
|
|
||||||
tablespaces: {}
|
|
||||||
databases: {}
|
|
||||||
schemas: {}
|
|
||||||
extensions: {}
|
|
||||||
postgresconf_backup: True
|
|
||||||
postgresconf: ""
|
|
||||||
|
|
||||||
# if prepare_cluster is over-ridden in any of:
|
# if prepare_cluster is over-ridden in any of:
|
||||||
# - osmap.yaml
|
# - osmap.yaml
|
||||||
|
@ -39,3 +22,24 @@ postgres:
|
||||||
command: service postgresql initdb
|
command: service postgresql initdb
|
||||||
test: test -f /var/lib/pgsql/data/PG_VERSION
|
test: test -f /var/lib/pgsql/data/PG_VERSION
|
||||||
env: {}
|
env: {}
|
||||||
|
|
||||||
|
conf_dir: /var/lib/pgsql/data
|
||||||
|
postgresconf: ""
|
||||||
|
postgresconf_backup: '.bak'
|
||||||
|
|
||||||
|
pg_hba.conf: salt://postgres/templates/pg_hba.conf.j2
|
||||||
|
acls:
|
||||||
|
# "local" is for Unix domain socket connections only
|
||||||
|
- ['local', 'all', 'all', 'peer']
|
||||||
|
# IPv4 local connections:
|
||||||
|
- ['host', 'all', 'all', '127.0.0.1/32', 'md5']
|
||||||
|
# IPv6 local connections:
|
||||||
|
- ['host', 'all', 'all', '::1/128', 'md5']
|
||||||
|
|
||||||
|
service: postgresql
|
||||||
|
|
||||||
|
users: {}
|
||||||
|
tablespaces: {}
|
||||||
|
databases: {}
|
||||||
|
schemas: {}
|
||||||
|
extensions: {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue