-
Notifications
You must be signed in to change notification settings - Fork 11
/
stack.cfg
30 lines (27 loc) · 1019 Bytes
/
stack.cfg
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
{#-
NOTE: Changes made to this file must be applied to the secret/stack.cfg by
running the following command:
salt mcp.magfest.net state.sls salt.master
-#}
{%- set roles = __grains__.get('roles', []) -%}
{%- if 'reggie' in roles -%}
{%- set env = __grains__.get('env') -%}
{%- set event_name = __grains__.get('event_name') -%}
{%- set event_year = __grains__.get('event_year') -%}
{%- set config_dirs = ['', env ~ '/'] -%}
{%- if event_name -%}
{%- do config_dirs.extend([event_name ~ '/', event_name ~ '_' ~ env ~ '/']) -%}
{%- if event_year -%}
{%- do config_dirs.extend([event_name ~ '_' ~ event_year ~ '/', event_name ~ '_' ~ event_year ~ '_' ~ env ~ '/']) -%}
{%- endif -%}
{%- endif -%}
{%- do config_dirs.append(minion_id ~ '/') -%}
{%- for config_dir in config_dirs|reverse %}
{{ config_dir }}init.yaml
{%- for role in roles %}
{%- if role != 'reggie' %}
{{ config_dir }}{{ role }}.yaml
{%- endif %}
{%- endfor %}
{%- endfor -%}
{%- endif -%}