mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 09:40:26 +00:00

which control three things: 1. should we initialize? 2. if so, how? 3. what environment variables and user to use The approach taken is very similar to what the Apache formula uses, namely: a default dictionary which is over-ridden by: os-specific defaults, then os codename defaults, then os finger defaults, and finally user-specified pillar values - this also adds support for grains['osfinger']
22 lines
650 B
Django/Jinja
22 lines
650 B
Django/Jinja
{% import_yaml "postgres/defaults.yaml" as defaults %}
|
|
{% import_yaml "postgres/osmap.yaml" as osmap %}
|
|
{% import_yaml "postgres/codenamemap.yaml" as oscodenamemap %}
|
|
{% import_yaml "postgres/osfingermap.yaml" as osfingermap %}
|
|
|
|
{% set _postgres = salt['grains.filter_by'](
|
|
osmap,
|
|
grain='os_family',
|
|
merge=salt['grains.filter_by'](
|
|
oscodenamemap,
|
|
grain='oscodename',
|
|
merge=salt['grains.filter_by'](
|
|
osfingermap,
|
|
grain='osfinger',
|
|
merge=salt['pillar.get']('postgres', {})
|
|
)
|
|
)
|
|
) %}
|
|
|
|
{% do defaults.postgres.update(_postgres) %}
|
|
|
|
{% set postgres = defaults.postgres %}
|