Add creation of user and db for the app.
This commit is contained in:
@@ -20,3 +20,24 @@ pg_hba.conf:
|
||||
- mode: 644
|
||||
- require:
|
||||
- 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