Skip to content

Instantly share code, notes, and snippets.

@munhitsu
Last active August 29, 2015 14:15
Show Gist options
  • Save munhitsu/1a95fb27fef8e6fd1beb to your computer and use it in GitHub Desktop.
Save munhitsu/1a95fb27fef8e6fd1beb to your computer and use it in GitHub Desktop.
salt hack to automatch/autogenerate role in top.sls (pillar or grain)
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 %}
@allensea-zz
Copy link

{% for role in grains.get('roles') %}
'roles:{{ role }}':
- match: grain
- role.{{ role }}
{% endfor %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment