mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 01:30:25 +00:00
Changed pillar data to use pillar.get and set defaults in init.sls
This commit is contained in:
parent
10e8fa89ba
commit
ae5e3e565a
1 changed files with 6 additions and 6 deletions
|
@ -15,7 +15,7 @@ postgresql:
|
||||||
pg_hba.conf:
|
pg_hba.conf:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ postgres.pg_hba }}
|
- name: {{ postgres.pg_hba }}
|
||||||
- source: {{ pillar['postgres']['pg_hba.conf'] }}
|
- source: {{ salt['pillar.get']('postgres:pg_hba.conf', 'salt://postgres/pg_hba.conf') }}
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- user: postgres
|
- user: postgres
|
||||||
- group: postgres
|
- group: postgres
|
||||||
|
@ -29,21 +29,21 @@ pg_hba.conf:
|
||||||
{% if 'db' in pillar.get('postgres', {}) %}
|
{% if 'db' in pillar.get('postgres', {}) %}
|
||||||
postgres-app-user:
|
postgres-app-user:
|
||||||
postgres_user.present:
|
postgres_user.present:
|
||||||
- name: {{ pillar['postgres']['db']['user'] }}
|
- name: {{ salt['pillar.get']('postgres:db:user', 'myuser') }}
|
||||||
- createdb: {{ pillar['postgres']['db']['createdb'] }}
|
- createdb: {{ salt['pillar.get']('postgres:db:createdb', False) }}
|
||||||
- password: {{ pillar['postgres']['db']['password'] }}
|
- password: {{ salt['pillar.get']('postgres:db:password', 'mypass') }}
|
||||||
- runas: postgres
|
- runas: postgres
|
||||||
- require:
|
- require:
|
||||||
- service: {{ postgres.service }}
|
- service: {{ postgres.service }}
|
||||||
|
|
||||||
postgres-app-db:
|
postgres-app-db:
|
||||||
postgres_database.present:
|
postgres_database.present:
|
||||||
- name: {{ pillar['postgres']['db']['name'] }}
|
- name: {{ salt['pillar.get']('postgres:db:name', 'mydb') }}
|
||||||
- encoding: UTF8
|
- encoding: UTF8
|
||||||
- lc_ctype: en_US.UTF8
|
- lc_ctype: en_US.UTF8
|
||||||
- lc_collate: en_US.UTF8
|
- lc_collate: en_US.UTF8
|
||||||
- template: template0
|
- template: template0
|
||||||
- owner: {{ pillar['postgres']['db']['user'] }}
|
- owner: {{ salt['pillar.get']('postgres:db:user', 'myuser') }}
|
||||||
- runas: postgres
|
- runas: postgres
|
||||||
- require:
|
- require:
|
||||||
- postgres_user: postgres-app-user
|
- postgres_user: postgres-app-user
|
||||||
|
|
Loading…
Add table
Reference in a new issue