Add support for database extensions.

This commit adds support for database extensions via
salt.states.postgres_extension

When configuring database pillar data all you need to do is add (optional)
extension list with the extensions that you want the state to apply to specific
database. Example:

    db1:
      owner: 'localUser'
      user: 'localUser'
      template: 'template0'
      lc_ctype: 'C.UTF-8'
      lc_collate: 'C.UTF-8'
      extensions:
        - uuid-ossp

This will make sure `uuid-ossp` extension is enabled on `db1` database.

Updated pillar.example to include (optional) extensions
This commit is contained in:
Edvinas Klovas
2015-07-23 17:51:24 +03:00
parent c87fa54cbf
commit d7580104f6
2 changed files with 16 additions and 2 deletions

View File

@@ -38,14 +38,18 @@ postgres:
template: 'template0'
lc_ctype: 'C.UTF-8'
lc_collate: 'C.UTF-8'
# optional extensions to enable on database
extensions:
- uuid-ossp
db2:
owner: 'localUser'
user: 'remoteUser'
template: 'template0'
lc_ctype: 'C.UTF-8'
lc_collate: 'C.UTF-8'
# optional extensions to enable on database
extensions:
- postgis
# This section will append your configuration to postgresql.conf.
postgresconf: |
listen_addresses = 'localhost,*'