summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2023-01-22 22:32:39 +0100
committerGeorg Pfuetzenreuter2023-01-22 22:39:14 +0100
commit0457625204a114a03c1f84b587f9bd003493b1c3 (patch)
treec5c6bf09dac2fef1d604ed134d7c6be809fd5085
parent48c9e05de1a9eafdf8deef9ee76920b3b6b5ed1d (diff)
downloadsalt-0457625204a114a03c1f84b587f9bd003493b1c3.tar.gz
salt-0457625204a114a03c1f84b587f9bd003493b1c3.tar.bz2
salt-0457625204a114a03c1f84b587f9bd003493b1c3.zip
Enforce ID and roles in top
Adapt to current private pillar top: - match ID grain for inclusion of ID files - move roles under conditional Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
-rw-r--r--pillar/top.sls9
1 files changed, 7 insertions, 2 deletions
diff --git a/pillar/top.sls b/pillar/top.sls
index d4c7639..ac21037 100644
--- a/pillar/top.sls
+++ b/pillar/top.sls
@@ -4,9 +4,14 @@
{{ 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 %}
+ - ignore_missing: True
- role.{{ role }}
{%- endfor %}
+{%- endif %}