Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save UtahDave/2d6ed4ed05df17c70228 to your computer and use it in GitHub Desktop.
Save UtahDave/2d6ed4ed05df17c70228 to your computer and use it in GitHub Desktop.
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