Skip to content

Commit

Permalink
refactor(map.jinja): cleanup map.jinja merge & add lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
rbjorklin committed Mar 30, 2019
1 parent c6ce242 commit a640f01
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions vault/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
{% import_yaml "vault/osfamilymap.yaml" as osfamilymap %}
{% import_yaml "vault/initfamilymap.yaml" as initfamilymap %}

{% set vault = salt['grains.filter_by'](
defaults, merge=salt['grains.filter_by'](
osfamilymap, merge=salt['grains.filter_by'](
initfamilymap, grain='init', merge=salt['pillar.get']('vault', {}),
base='vault'),
base='vault'),
base='vault')
%}
{%- set merged_defaults = salt['grains.filter_by'](defaults,
default='vault',
merge=salt['grains.filter_by'](osfamilymap, grain='os_family',
merge=salt['grains.filter_by'](initfamilymap, grain='init',
merge=salt['pillar.get']('vault:lookup', default={})
)
)
) %}

{#- Merge the vault pillar #}
{%- set vault = salt['pillar.get']('vault', default=merged_defaults, merge=True) %}

0 comments on commit a640f01

Please sign in to comment.