salt/pillar/top.sls
Georg Pfuetzenreuter 0efd688151
All checks were successful
ci/lysergic/push/pipeline Pipeline was successful
Use http.query instead of nbroles module
This is an attempt to remove the need for the custom nbroles module. If
it works out, the localhost reference should be replaced with a global
roles API endpoint.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2023-01-22 16:32:57 +01:00

13 lines
364 B
Plaintext

{%- set id = salt['grains.get']('id') -%}
{%- set roles = salt['http.query']('http://127.0.0.1:5000/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 %}