support schemas
This commit is contained in:
@@ -52,6 +52,9 @@ postgres:
|
|||||||
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
|
# optional extensions to enable on database
|
||||||
|
schemas:
|
||||||
|
uuid_ossp:
|
||||||
|
owner: localUser
|
||||||
extensions:
|
extensions:
|
||||||
- uuid-ossp
|
- uuid-ossp
|
||||||
db2:
|
db2:
|
||||||
|
|||||||
@@ -118,6 +118,20 @@ postgres-db-{{ name }}:
|
|||||||
- postgres_user: postgres-user-{{ db.get('user') }}
|
- postgres_user: postgres-user-{{ db.get('user') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if db.schemas is defined %}
|
||||||
|
{% for schema, schema_args in db.schemas.items() %}
|
||||||
|
postgres-schema-{{ schema }}-for-db-{{ name }}:
|
||||||
|
postgres_schema.present:
|
||||||
|
- name: {{ schema }}
|
||||||
|
- dbname: {{ name }}
|
||||||
|
{% if schema_args is not none %}
|
||||||
|
{% for arg, value in schema_args.items() %}
|
||||||
|
- {{ arg }}: {{ value }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if db.extensions is defined %}
|
{% if db.extensions is defined %}
|
||||||
{% for ext in db.extensions %}
|
{% for ext in db.extensions %}
|
||||||
postgres-ext-{{ ext }}-for-db-{{ name }}:
|
postgres-ext-{{ ext }}-for-db-{{ name }}:
|
||||||
|
|||||||
Reference in New Issue
Block a user