Wrap the Postgres conf file in an if-statement; grab source from Pillar
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user