diff --git a/sysctl/_mapdata/init.sls b/sysctl/_mapdata/init.sls index a884b2a..3529a8d 100644 --- a/sysctl/_mapdata/init.sls +++ b/sysctl/_mapdata/init.sls @@ -3,10 +3,10 @@ --- {#- Get the `tplroot` from `tpldir` #} {%- set tplroot = tpldir.split("/")[0] %} -{%- from tplroot ~ "/map.jinja" import sysctl_settings with context %} +{%- from tplroot ~ "/map.jinja" import mapdata with context %} {%- set _mapdata = { - "values": sysctl_settings, + "values": mapdata, } %} {%- do salt["log.debug"]("### MAP.JINJA DUMP ###\n" ~ _mapdata | yaml(False)) %} diff --git a/sysctl/defaults.yml b/sysctl/defaults.yml deleted file mode 100644 index 8d79cc0..0000000 --- a/sysctl/defaults.yml +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=yaml ---- -sysctl: - pkg: procps-ng - config: - location: '/etc/sysctl.d' diff --git a/sysctl/libmapstack.jinja b/sysctl/libmapstack.jinja new file mode 100644 index 0000000..8f54ef3 --- /dev/null +++ b/sysctl/libmapstack.jinja @@ -0,0 +1,315 @@ +{#- -*- coding: utf-8 -*- #} +{#- vim: ft=jinja #} + +{#- Get the `tplroot` from `tpldir` #} +{%- set tplroot = tpldir.split("/")[0] %} +{%- from tplroot ~ "/libmatchers.jinja" import parse_matchers, query_map with context %} + +{%- set _default_config_dirs = [ + "parameters/", + tplroot ~ "/parameters" + ] %} + +{%- macro mapstack( + matchers, + defaults=None, + dirs=_default_config_dirs, + log_prefix="libmapstack: " + ) %} +{#- + 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: + + - `matchers`: list of matchers in the form + `[[: