-
-
Save ksaio/3e6f94c0fab976be9fe59440814b955b to your computer and use it in GitHub Desktop.
salt pillar
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
{% set server = salt['grains.get']('id').lower() %} | |
base: | |
'*': | |
# company | |
{% if server == '/se-.*.company.net/' %} | |
- company/default | |
- company/{{ server }} | |
# company2 | |
{% elif server == '/int-.*.company2.com/' %} | |
- company2/default | |
- company2/{{ server }} | |
# company3 dev | |
{% elif server == '/.*.dev.company3.org/' %} | |
- company3/default | |
- company3/{{ server }} | |
{% else %} | |
- default | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure how to handle "default", but...
The alternative is to use a Jinja dict as a lookup and substring matching (because regex doesn't work).