postgres-formula/postgres/map.jinja
Brian Jackson 967fa6504b Switch to new style map.jinja
Move this formula to the new style map.jinja. Still need to sort out RedHat
handling, but it's not any worse than it was before (i.e. horribly broken)
2015-04-22 17:47:02 -05:00

22 lines
1 KiB
Django/Jinja

{% import_yaml "postgres/defaults.yaml" as defaults %}
{% import_yaml "postgres/osmap.yaml" as osmap %}
{% import_yaml "postgres/codenamemap.yaml" as codemap %}
{# get the settings for the os_family grain #}
{% set osfam = salt['grains.filter_by'](osmap) or {} %}
{# get the settings for the oscodename grain, os_family data will override
oscodename data #}
{% set oscode = salt['grains.filter_by'](codemap,
grain='oscodename',
merge=osfam) or {} %}
{# merge the os family/codename specific data over the defaults #}
{% do defaults.postgres.update(oscode) %}
{# merge the pillar:lookup dict into the defaults/os specific dict #}
{% set lookup = salt['pillar.get']('postgres:lookup',
default=defaults.postgres,
merge=True) %}
{# merge the actual postgres pillar into the above combined dict #}
{% set postgres = salt['pillar.get']('postgres', default=lookup, merge=True) %}