paulbsd-salt/states/postgresql/databases.sls

16 lines
550 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "postgresql/map.jinja" import postgresql with context %}
{%- for database in postgresql.databases %}
postgresql_database_{{ database.name }}:
postgres_database.present:
- name: {{ database.name }}
- owner: {{ database.user }}
- db_user: postgres
- template: template0
- encoding: {{ database.encoding }}
- lc_collate: {{ database.collate|default("en_US.UTF-8") }}
- lc_ctype: {{ database.ctype|default("en_US.UTF-8") }}
- require:
- postgres_user: postgresql_user_{{ database.user }}
{% endfor %}