Wrap the Postgres conf file in an if-statement; grab source from Pillar

This commit is contained in:
Seth House 2014-05-16 10:56:10 -06:00
parent f17fac7a2e
commit 9ac9a4610e
2 changed files with 5 additions and 2 deletions

View file

@ -8,4 +8,5 @@ postgres:
pkg: postgresql-9.3 pkg: postgresql-9.3
db: db:
name: mydb name: mydb
user: mydb user: mydb
pg_hba.conf: salt://postgres/pg_hba.conf

View file

@ -13,16 +13,18 @@ postgresql:
- require: - require:
- pkg: {{ postgres.pkg }} - pkg: {{ postgres.pkg }}
{% if 'pg_hba.conf' in pillar['postgres'] %}
pg_hba.conf: pg_hba.conf:
file.managed: file.managed:
- name: {{ postgres.pg_hba }} - name: {{ postgres.pg_hba }}
- source: salt://postgres/pg_hba.conf - source: {{ pillar['postgres']['pg_hba.conf'] }}
- template: jinja - template: jinja
- user: postgres - user: postgres
- group: postgres - group: postgres
- mode: 644 - mode: 644
- require: - require:
- pkg: {{ postgres.pkg }} - pkg: {{ postgres.pkg }}
{% endif %}
postgres-app-user: postgres-app-user:
postgres_user.present: postgres_user.present: