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

@ -9,3 +9,4 @@ postgres:
db:
name: mydb
user: mydb
pg_hba.conf: salt://postgres/pg_hba.conf

View file

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