Add creation of user and db for the app.
This commit is contained in:
@@ -19,4 +19,25 @@ pg_hba.conf:
|
|||||||
- group: postgres
|
- group: postgres
|
||||||
- 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
|
||||||
|
|||||||
Reference in New Issue
Block a user