diff --git a/cert/libmapstack.jinja b/cert/libmapstack.jinja index e965150..28fcf8d 100644 --- a/cert/libmapstack.jinja +++ b/cert/libmapstack.jinja @@ -190,7 +190,7 @@ {#- Load YAML file matching the grain/pillar/... #} {#- Fallback to use the source name as a direct filename #} -{%- if matcher.value | length == 0 %} +{%- if matcher.value is sequence and matcher.value | length == 0 %} {#- Mangle `matcher.value` to use it as literal path #} {%- set query_parts = matcher.query.split("/") %} {%- set yaml_dirname = query_parts[0:-1] | join("/") %} @@ -203,6 +203,11 @@ {#- Some configuration return list #} {%- if yaml_names is string %} {%- set yaml_names = [yaml_names] %} +{%- elif yaml_names is sequence %} +{#- Convert to strings if it's a sequence of numbers #} +{%- set yaml_names = yaml_names | map("string") | list %} +{%- else %} +{%- set yaml_names = [yaml_names | string] %} {%- endif %} {#- Try to load a `.yaml.jinja` file for each `.yaml` file #} diff --git a/cert/libmatchers.jinja b/cert/libmatchers.jinja index 3723612..e8de5d7 100644 --- a/cert/libmatchers.jinja +++ b/cert/libmatchers.jinja @@ -21,11 +21,11 @@ } %} {#- When no part before `@` is provided: #} -{#- - define a filename path, noted `F` #} +{#- - define a YAML file path, noted `Y` #} {#- - use `salt["config.get"]`, noted `C` #} {#- - use colon `:` delimiter for querying #} {%- set _defaults = { - "type": "F", + "type": "Y", "query_type": "C", "query_delimiter": ":" } %} @@ -37,11 +37,11 @@ ) %} {#- matcher format is `[[: