diff --git a/openssh/libmapstack.jinja b/openssh/libmapstack.jinja index 9ea212b..bef5e5a 100644 --- a/openssh/libmapstack.jinja +++ b/openssh/libmapstack.jinja @@ -3,39 +3,104 @@ {#- Get the `tplroot` from `tpldir` #} {%- set tplroot = tpldir.split("/")[0] %} +{%- from tplroot ~ "/libmatchers.jinja" import parse_matchers, query_map %} + +{%- set _default_config_dirs = [ + "parameters/", + tplroot ~ "/parameters" + ] %} {%- macro mapstack( - files, + matchers, defaults=None, + dirs=_default_config_dirs, log_prefix="libmapstack: " ) %} {#- - Load YAML files in the order of `files` and merge successively the - values with `defaults` if the file exists. + Load configuration in the order of `matchers` and merge + successively the values with `defaults`. + + The `matchers` are processed using `libmatchers.jinja` to select + the configuration sources from where the values are loaded. Parameters: - - `files`: list of files to load - - `defaults`: default values to start the merging, they are - considered built-ins + - `matchers`: list of matchers in the form + `[[: