2014-01-26 04:36:15 +00:00
|
|
|
{% from "postgres/map.jinja" import postgres with context %}
|
2014-01-26 04:06:22 +00:00
|
|
|
|
2013-07-16 10:23:53 -06:00
|
|
|
postgresql:
|
2014-01-26 04:06:22 +00:00
|
|
|
pkg:
|
|
|
|
- installed
|
|
|
|
- name: {{ postgres.pkg }}
|
2014-02-09 17:50:23 +01:00
|
|
|
service:
|
|
|
|
- running
|
|
|
|
- enable: true
|
|
|
|
- name: {{ postgres.service }}
|
|
|
|
- require:
|
|
|
|
- pkg: {{ postgres.pkg }}
|
2013-07-16 10:23:53 -06:00
|
|
|
|
2014-05-15 14:44:39 -07:00
|
|
|
pg_hba.conf:
|
|
|
|
file.managed:
|
|
|
|
- name: {{ postgres.pg_hba }}
|
|
|
|
- source: salt://postgres/pg_hba.conf
|
|
|
|
- user: postgres
|
|
|
|
- group: postgres
|
|
|
|
- mode: 644
|
|
|
|
- require:
|
2014-05-15 15:06:04 -07:00
|
|
|
- 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
|