mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 01:30:25 +00:00

which control three things: 1. should we initialize? 2. if so, how? 3. what environment variables and user to use The approach taken is very similar to what the Apache formula uses, namely: a default dictionary which is over-ridden by: os-specific defaults, then os codename defaults, then os finger defaults, and finally user-specified pillar values - this also adds support for grains['osfinger']
86 lines
2.1 KiB
Text
86 lines
2.1 KiB
Text
postgres:
|
|
pg_hba.conf: salt://postgres/pg_hba.conf
|
|
prepare_cluster:
|
|
user: root
|
|
command: service postgresql initdb
|
|
test: test -f /path/to/some/file
|
|
env:
|
|
LC_ALL: C.UTF-8
|
|
|
|
use_upstream_repo: False
|
|
|
|
pkg: 'postgresql-9.3'
|
|
pkg_client: 'postgresql-client-9.3'
|
|
pkgs_extra:
|
|
- postgresql-contrib
|
|
- postgresql-plpython
|
|
|
|
users:
|
|
localUser:
|
|
ensure: present
|
|
password: '98ruj923h4rf'
|
|
createdb: False
|
|
createroles: False
|
|
createuser: False
|
|
inherit: True
|
|
replication: False
|
|
|
|
remoteUser:
|
|
ensure: present
|
|
password: '98ruj923h4rf'
|
|
createdb: False
|
|
createroles: False
|
|
createuser: False
|
|
inherit: True
|
|
replication: False
|
|
|
|
absentUser:
|
|
ensure: absent
|
|
password: '98ruj923h4rf'
|
|
createdb: False
|
|
createroles: False
|
|
createuser: False
|
|
inherit: True
|
|
replication: False
|
|
|
|
# This section cover this ACL management of the pg_hba.conf file.
|
|
# <type>, <database>, <user>, [host], <method>
|
|
acls:
|
|
- ['local', 'db1', 'localUser']
|
|
- ['host', 'db2', 'remoteUser', '123.123.0.0/24']
|
|
|
|
tablespaces:
|
|
my_space: /srv/my_tablespace
|
|
|
|
databases:
|
|
db1:
|
|
owner: 'localUser'
|
|
user: 'localUser'
|
|
template: 'template0'
|
|
lc_ctype: 'C.UTF-8'
|
|
lc_collate: 'C.UTF-8'
|
|
# optional schemas to enable on database
|
|
schemas:
|
|
uuid_ossp:
|
|
owner: localUser
|
|
# optional extensions to enable on database
|
|
extensions:
|
|
uuid-ossp:
|
|
schema: uuid_ossp
|
|
db2:
|
|
owner: 'localUser'
|
|
user: 'remoteUser'
|
|
template: 'template0'
|
|
lc_ctype: 'C.UTF-8'
|
|
lc_collate: 'C.UTF-8'
|
|
tablespace: 'my_space'
|
|
# optional extensions to enable on database
|
|
# extensions:
|
|
# 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,*'
|
|
|