-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtop.sls
More file actions
33 lines (33 loc) · 1.18 KB
/
top.sls
File metadata and controls
33 lines (33 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{% set ID, HST, POD, LOC, POD__LOC, HST__POD = salt.meta.classify() -%}
{% set LOOKUP = {"1_LOC": ["(location)", LOC],
"2_POD": ["(pod/group)", POD],
"3_HST": ["(host/role)", HST],
"4_POD__LOC": ["(pod/group and location)", POD__LOC],
"5_HST__POD": ["(host/role and pod/group)", HST__POD],
"6_ID": ["(Full ID)", ID]} -%}
{# The following {{ saltenv }} together with the pillarenv_from_saltenv: True
# configuration value allows the use of development environments without
# impacting/destabilizing the base environment
-#}
{{ saltenv }}:
'*':
# 0. Global (all Minions)
- all
- classification
- letsencrypt
- postfix.secrets
- salt
- user
- user.passwords.*
{%- for key in LOOKUP.keys()|sort %}
{%- set data = LOOKUP[key] %}
{%- set lookup_init = "{}/{}/init.sls".format(key, data[1]) %}
{%- set lookup_sls = "{}/{}.sls".format(key, data[1]) %}
# {{ key }} {{ data[0]}}
{%- if (salt["pillar.file_exists"](lookup_init, saltenv=saltenv) or
salt["pillar.file_exists"](lookup_sls, saltenv=saltenv)) %}
- {{ key }}.{{ data[1] }}
{%- else %}
# - None
{%- endif %}
{%- endfor %}