Merge pull request #62 from edvinasme/add-database-extension-support
Add support for database extensions.
This commit is contained in:
@@ -38,14 +38,18 @@ postgres:
|
|||||||
template: 'template0'
|
template: 'template0'
|
||||||
lc_ctype: 'C.UTF-8'
|
lc_ctype: 'C.UTF-8'
|
||||||
lc_collate: 'C.UTF-8'
|
lc_collate: 'C.UTF-8'
|
||||||
|
# optional extensions to enable on database
|
||||||
|
extensions:
|
||||||
|
- uuid-ossp
|
||||||
db2:
|
db2:
|
||||||
owner: 'localUser'
|
owner: 'localUser'
|
||||||
user: 'remoteUser'
|
user: 'remoteUser'
|
||||||
template: 'template0'
|
template: 'template0'
|
||||||
lc_ctype: 'C.UTF-8'
|
lc_ctype: 'C.UTF-8'
|
||||||
lc_collate: '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.
|
# This section will append your configuration to postgresql.conf.
|
||||||
postgresconf: |
|
postgresconf: |
|
||||||
listen_addresses = 'localhost,*'
|
listen_addresses = 'localhost,*'
|
||||||
|
|||||||
@@ -103,6 +103,16 @@ postgres-db-{{ name }}:
|
|||||||
- require:
|
- require:
|
||||||
- postgres_user: postgres-user-{{ db.get('user') }}
|
- postgres_user: postgres-user-{{ db.get('user') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if db.extensions is defined %}
|
||||||
|
{% for ext in db.extensions %}
|
||||||
|
postgres-ext-{{ ext }}-for-db-{{ name }}:
|
||||||
|
postgres_extension.present:
|
||||||
|
- name: {{ ext }}
|
||||||
|
- user: {{ db.get('runas', 'postgres') }}
|
||||||
|
- maintenance_db: {{ name }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% endfor%}
|
{% endfor%}
|
||||||
|
|
||||||
{% for name, directory in postgres.tablespaces.items() %}
|
{% for name, directory in postgres.tablespaces.items() %}
|
||||||
|
|||||||
Reference in New Issue
Block a user