summaryrefslogtreecommitdiffstats
path: root/pillar/top.sls
blob: d4c7639f435e28c0ee6ff40a0e48544a0af604c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
{%- set id = salt['grains.get']('id') -%}
{%- set roles = salt['http.query']('http://machine-roles.lysergic.dev:4580/roles', decode=True, decode_type='json', params={"machine": id})['dict']['roles'] -%}

{{ saltenv }}:
  '*':
    - common
  '{{ id }}':
    - ignore_missing: True
    - id.{{ id.replace('.', '_') }}
  {%- for role in roles %}
    - role.{{ role }}
  {%- endfor %}