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 %}
2021-08-19 21:15:38 +02:00
postgresql-database-{{ database.name }}:
2020-07-10 00:58:55 +02:00
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:
2021-08-19 21:15:38 +02:00
- postgres_user: postgresql-user-{{ database.user }}
2020-07-10 00:58:55 +02:00
{% endfor %}