diff --git a/openssh/libmatchers.jinja b/openssh/libmatchers.jinja new file mode 100644 index 0000000..b5e768d --- /dev/null +++ b/openssh/libmatchers.jinja @@ -0,0 +1,208 @@ +{#- -*- coding: utf-8 -*- #} +{#- vim: ft=jinja #} + +{#- Get the `tplroot` from `tpldir` #} +{%- set tplroot = tpldir.split("/")[0] %} +{%- from tplroot ~ "/libsaltcli.jinja" import cli %} + +{%- set query_map = { + "C": "config.get", + "G": "grains.get", + "I": "pillar.get", + } %} + +{#- When no part before `@` is provided: #} +{#- - define a filename path, noted `F` #} +{#- - use `salt["config.get"]`, noted `C` #} +{%- set _defaults = { + "type": "F", + "query_type": "C", + } %} + +{%- macro parse_matchers( + matchers, + config_get_strategy=None, + log_prefix="libmatchers: " + ) %} +{#- matcher format is `[[: