summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 %}