-
-
Save UtahDave/2d6ed4ed05df17c70228 to your computer and use it in GitHub Desktop.
This file contains 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 each directory that can have pillar files | |
{% for root in opts['pillar_roots']['base'] -%} | |
# Set a variable to the path to check | |
{% set mygrain_sls = '{0}/{1}.sls'.format(root, grains['mygrain']) -%} | |
# Check to see if the file exists, if so, include that pillar file. | |
{% if salt['file.file_exists'](mygrain_sls) %} | |
'service_group:{{ grains["mygrain"] }}': | |
- match: grain | |
- {{ grains['mygrain'] }} | |
{% endif %} | |
{% endfor -%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment