diff options
author | Georg Pfuetzenreuter | 2023-01-22 16:32:57 +0100 |
---|---|---|
committer | Georg Pfuetzenreuter | 2023-01-22 16:32:57 +0100 |
commit | 0efd688151a3f93cda226e6bc86490a6f3110ba1 (patch) | |
tree | fd6e949d47575afa19ea3a5763b7f2b4de3f698f /pillar/top.sls | |
parent | 06a36e62ae783600a98115258ab4a3c6095888d1 (diff) | |
download | salt-0efd688151a3f93cda226e6bc86490a6f3110ba1.tar.gz salt-0efd688151a3f93cda226e6bc86490a6f3110ba1.tar.bz2 salt-0efd688151a3f93cda226e6bc86490a6f3110ba1.zip |
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>
Diffstat (limited to 'pillar/top.sls')
-rw-r--r-- | pillar/top.sls | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pillar/top.sls b/pillar/top.sls index 3302bd8..13efc78 100644 --- a/pillar/top.sls +++ b/pillar/top.sls @@ -1,5 +1,5 @@ {%- set id = salt['grains.get']('id') -%} -{%- set roles = salt['nbroles.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 }}: '*': @@ -7,6 +7,6 @@ '{{ id }}': - ignore_missing: True - id.{{ id.replace('.', '_') }} - {% for role in roles %} + {%- for role in roles %} - role.{{ role }} {%- endfor %} |