diff options
author | Georg Pfuetzenreuter | 2023-01-22 22:32:39 +0100 |
---|---|---|
committer | Georg Pfuetzenreuter | 2023-01-22 22:39:14 +0100 |
commit | 0457625204a114a03c1f84b587f9bd003493b1c3 (patch) | |
tree | c5c6bf09dac2fef1d604ed134d7c6be809fd5085 | |
parent | 48c9e05de1a9eafdf8deef9ee76920b3b6b5ed1d (diff) | |
download | salt-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.sls | 9 |
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 %} |