mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 09:40:26 +00:00
Add creation of user and db for the app.
This commit is contained in:
parent
ac7e017eb5
commit
4a2a60f6bf
1 changed files with 22 additions and 1 deletions
|
@ -20,3 +20,24 @@ pg_hba.conf:
|
||||||
- mode: 644
|
- mode: 644
|
||||||
- require:
|
- require:
|
||||||
- pkg: {{ postgres.pkg }}
|
- pkg: {{ postgres.pkg }}
|
||||||
|
|
||||||
|
postgres-app-user:
|
||||||
|
postgres_user.present:
|
||||||
|
- name: {{ pillar['postgres']['db']['user'] }}
|
||||||
|
- createdb: {{ pillar['postgres']['db']['createdb'] }}
|
||||||
|
- password: {{ pillar['postgres']['db']['password'] }}
|
||||||
|
- runas: postgres
|
||||||
|
- require:
|
||||||
|
- service: {{ postgres.service }}
|
||||||
|
|
||||||
|
postgres-app-db:
|
||||||
|
postgres_database.present:
|
||||||
|
- name: {{ pillar['postgres']['db']['name'] }}
|
||||||
|
- encoding: UTF8
|
||||||
|
- lc_ctype: en_US.UTF8
|
||||||
|
- lc_collate: en_US.UTF8
|
||||||
|
- template: template0
|
||||||
|
- owner: {{ pillar['postgres']['db']['user'] }}
|
||||||
|
- runas: postgres
|
||||||
|
- require:
|
||||||
|
- postgres_user: postgres-app-user
|
||||||
|
|
Loading…
Add table
Reference in a new issue