2014-05-06 11:48:21 -06:00
|
|
|
postgres:
|
2016-09-03 15:15:56 +03:00
|
|
|
# Set True to configure upstream postgresql.org repository for YUM or APT
|
2015-04-22 17:47:02 -05:00
|
|
|
use_upstream_repo: False
|
2016-09-03 15:15:56 +03:00
|
|
|
# Version to install from upstream repository
|
|
|
|
version: '9.3'
|
2015-02-01 14:40:45 +00:00
|
|
|
|
2016-09-06 12:34:17 +03:00
|
|
|
# These are Debian/Ubuntu specific package names
|
2016-07-08 15:34:45 -05:00
|
|
|
pkg: 'postgresql-9.3'
|
|
|
|
pkg_client: 'postgresql-client-9.3'
|
2016-09-03 15:15:56 +03:00
|
|
|
|
|
|
|
# Addtional packages to install, this should be in a list format
|
2016-07-08 15:34:45 -05:00
|
|
|
pkgs_extra:
|
|
|
|
- postgresql-contrib
|
|
|
|
- postgresql-plpython
|
2014-07-27 22:04:57 -04:00
|
|
|
|
2016-09-06 12:34:17 +03:00
|
|
|
# Path to the `pg_hba.conf` file Jinja template on Salt Fileserver
|
|
|
|
pg_hba.conf: salt://postgres/templates/pg_hba.conf.j2
|
|
|
|
|
|
|
|
# This section covers ACL management in the `pg_hba.conf` file.
|
|
|
|
# acls list controls: which hosts are allowed to connect, how clients
|
|
|
|
# are authenticated, which PostgreSQL user names they can use, which
|
|
|
|
# databases they can access. Records take one of these forms:
|
|
|
|
#
|
|
|
|
#acls:
|
|
|
|
# - ['local', 'DATABASE', 'USER', 'METHOD']
|
|
|
|
# - ['host', 'DATABASE', 'USER', 'ADDRESS', 'METHOD']
|
|
|
|
# - ['hostssl', 'DATABASE', 'USER', 'ADDRESS', 'METHOD']
|
|
|
|
# - ['hostnossl', 'DATABASE', 'USER', 'ADDRESS', 'METHOD']
|
|
|
|
#
|
|
|
|
# The uppercase items must be replaced by actual values.
|
|
|
|
# METHOD could be omitted, 'md5' will be appended by default.
|
|
|
|
acls:
|
|
|
|
- ['local', 'db1', 'localUser']
|
2016-09-09 11:36:26 +03:00
|
|
|
- ['host', 'db2', 'remoteUser', '192.168.33.0/24']
|
2016-09-06 12:34:17 +03:00
|
|
|
|
|
|
|
# PostgreSQL service name
|
|
|
|
service: postgresql
|
2016-09-03 15:15:56 +03:00
|
|
|
|
2016-09-09 11:36:26 +03:00
|
|
|
# Create/remove users, tablespaces, databases, schema and extensions.
|
|
|
|
# Each of these dictionaries contains PostgreSQL entities which
|
|
|
|
# mapped to the `postgres_*` Salt states with arguments. See the Salt
|
|
|
|
# documentaion to get all supported argument for a particular state.
|
|
|
|
#
|
|
|
|
# Format is the following:
|
|
|
|
#
|
|
|
|
#<users|tablespaces|databases|schemas|extensions>:
|
|
|
|
# NAME:
|
|
|
|
# ensure: <present|absent> # 'present' is the default
|
|
|
|
# ARGUMENT: VALUE
|
|
|
|
# ...
|
|
|
|
#
|
|
|
|
# where 'NAME' is the state name, 'ARGUMENT' is the kwarg name, and
|
|
|
|
# 'VALUE' is kwarg value.
|
|
|
|
#
|
|
|
|
# For example, the Pillar:
|
|
|
|
#
|
|
|
|
#users:
|
|
|
|
# testUser:
|
|
|
|
# password: test
|
|
|
|
#
|
|
|
|
# will render such state:
|
|
|
|
#
|
|
|
|
#postgres_user-testUser:
|
|
|
|
# postgres_user.present:
|
|
|
|
# - name: testUser
|
|
|
|
# - password: test
|
2014-07-27 22:04:57 -04:00
|
|
|
users:
|
|
|
|
localUser:
|
2015-10-06 13:24:53 +02:00
|
|
|
ensure: present
|
2014-07-27 22:04:57 -04:00
|
|
|
password: '98ruj923h4rf'
|
|
|
|
createdb: False
|
2015-05-05 15:10:34 -07:00
|
|
|
createroles: False
|
|
|
|
createuser: False
|
|
|
|
inherit: True
|
|
|
|
replication: False
|
2014-07-27 22:04:57 -04:00
|
|
|
|
|
|
|
remoteUser:
|
2015-10-06 13:24:53 +02:00
|
|
|
ensure: present
|
|
|
|
password: '98ruj923h4rf'
|
|
|
|
createdb: False
|
|
|
|
createroles: False
|
|
|
|
createuser: False
|
|
|
|
inherit: True
|
|
|
|
replication: False
|
|
|
|
|
|
|
|
absentUser:
|
|
|
|
ensure: absent
|
2014-07-27 22:04:57 -04:00
|
|
|
|
2016-06-08 07:36:28 -03:00
|
|
|
tablespaces:
|
2016-08-05 20:22:51 +02:00
|
|
|
my_space:
|
|
|
|
directory: /srv/my_tablespace
|
|
|
|
owner: localUser
|
2016-06-08 07:36:28 -03:00
|
|
|
|
2014-07-27 22:04:57 -04:00
|
|
|
databases:
|
|
|
|
db1:
|
|
|
|
owner: 'localUser'
|
|
|
|
template: 'template0'
|
2016-07-19 10:10:56 -05:00
|
|
|
lc_ctype: 'en_US.UTF-8'
|
|
|
|
lc_collate: 'en_US.UTF-8'
|
2014-07-27 22:04:57 -04:00
|
|
|
db2:
|
2016-09-09 11:36:26 +03:00
|
|
|
owner: 'remoteUser'
|
2014-07-27 22:04:57 -04:00
|
|
|
template: 'template0'
|
2016-07-19 10:10:56 -05:00
|
|
|
lc_ctype: 'en_US.UTF-8'
|
|
|
|
lc_collate: 'en_US.UTF-8'
|
2016-06-08 07:36:28 -03:00
|
|
|
tablespace: 'my_space'
|
2016-09-05 13:49:33 +03:00
|
|
|
|
2016-09-09 11:36:26 +03:00
|
|
|
# optional schemas to enable on database
|
|
|
|
schemas:
|
|
|
|
uuid_ossp:
|
|
|
|
dbname: db1
|
|
|
|
owner: localUser
|
|
|
|
|
|
|
|
# optional extensions to install in schema
|
|
|
|
extensions:
|
|
|
|
uuid-ossp:
|
|
|
|
schema: uuid_ossp
|
|
|
|
maintenance_db: db1
|
|
|
|
#postgis: {}
|
|
|
|
|
|
|
|
# Backup extension defaults to .bak if postgresconf_backup is True.
|
2016-03-14 19:19:32 +00:00
|
|
|
# Set to False to stop creation of backup on postgresql.conf changes.
|
|
|
|
postgresconf_backup: True
|
2014-10-06 11:34:43 +02:00
|
|
|
# This section will append your configuration to postgresql.conf.
|
|
|
|
postgresconf: |
|
|
|
|
listen_addresses = 'localhost,*'
|
|
|
|
|
2016-09-03 15:15:56 +03:00
|
|
|
# vim: ft=yaml:sw=2
|