paulbsd-salt/states/postgresql/databases.sls

17 lines
629 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
2022-07-27 23:49:02 +02:00
- encoding: {{ database.encoding|default("UTF8") }}
2020-07-10 00:58:55 +02:00
- lc_collate: {{ database.collate|default("en_US.UTF-8") }}
- lc_ctype: {{ database.ctype|default("en_US.UTF-8") }}
2022-07-27 23:49:02 +02:00
- db_port: {{ postgresql.config.main.port|default(5432) }}
2020-07-10 00:58:55 +02:00
- require:
2021-08-19 21:15:38 +02:00
- postgres_user: postgresql-user-{{ database.user }}
2020-07-10 00:58:55 +02:00
{% endfor %}