mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-17 10:10:31 +00:00
support schemas
This commit is contained in:
parent
401912743e
commit
8edafaf7a4
2 changed files with 17 additions and 0 deletions
|
@ -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 }}:
|
||||||
|
|
Loading…
Add table
Reference in a new issue