From 772f6b374a49876dfe05070fb3a53f922ed0f376 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sun, 22 Jan 2023 22:32:39 +0100 Subject: [PATCH] Enforce ID and roles in top Adapt to current private pillar top: - match ID grain for inclusion of ID files - check for role existence Signed-off-by: Georg Pfuetzenreuter --- pillar/top.sls | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pillar/top.sls b/pillar/top.sls index d4c7639..a72ded3 100644 --- a/pillar/top.sls +++ b/pillar/top.sls @@ -4,9 +4,13 @@ {{ saltenv }}: '*': - common - '{{ id }}': + 'id:{{ id }}': + - match: grain - ignore_missing: True - id.{{ id.replace('.', '_') }} - {%- for role in roles %} +{%- if roles | length > 0 %} + '{{ id }}': + {% for role in roles %} - role.{{ role }} {%- endfor %} +{%- endif %}