From 174bb68432366a449a8327a9dbb648271f123224 Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Mon, 11 Jan 2021 17:57:30 +0100 Subject: [PATCH] refactor(map): load `defaults.jinja` configuration with `libmapstack` --- openssh/map.jinja | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/openssh/map.jinja b/openssh/map.jinja index 8280213..367b24d 100644 --- a/openssh/map.jinja +++ b/openssh/map.jinja @@ -44,18 +44,12 @@ {#- Load formula defaults values #} {%- set _defaults_filename = map_sources_dir ~ "/defaults.yaml" %} -{%- do salt["log.debug"]( - "map.jinja: load per formula default values from " - ~ _defaults_filename - ) %} -{%- load_yaml as default_settings %} -{%- include _defaults_filename ignore missing %} -{%- endload %} - -{%- if not default_settings %} -{%- set default_settings = {'values': {} } %} -{%- endif %} - +{%- set default_settings = mapstack( + files=[_defaults_filename], + defaults={"values": {} }, + log_prefix="map.jinja defaults: ", + ) + | load_yaml %} {#- Make sure to track `map.jinja` configuration with `_mapdata` #} {%- do default_settings["values"].update( {