{% 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, grain='os_family') 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) %}