{#- Get the `tplroot` from `tpldir` #} {%- set fbkusersroot = slspath.split('/')[0] %} {%- from fbkusersroot ~ "/map.jinja" import fbkusers with context %} {% if pillar.fbkusers is defined %} {% for user, options in fbkusers.items() %} {% if options["groups"] %} {% for group in option["groups"] %} {% if salt['group.info'](group) %} {{ group }}-{{ user }}: group.present: - name: {{ group }} - addusers: - {{ user }} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endif %}