Last active
August 29, 2015 14:15
-
-
Save munhitsu/1a95fb27fef8e6fd1beb to your computer and use it in GitHub Desktop.
salt hack to automatch/autogenerate role in top.sls (pillar or grain)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
base: | |
{% for role in grains.get('roles') %} | |
'roles:{{ role }}': | |
- match: grain | |
- {{ role }} | |
{% endfor %} | |
{% for role in grains.get('roles') %} | |
'roles:{{ role }}': | |
- match: grain | |
- {{ role }}.{{ grains.get('environment') }} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{% for role in grains.get('roles') %}
'roles:{{ role }}':
- match: grain
- role.{{ role }}
{% endfor %}