-
-
Save mikeywaites/477a8acdf795e0188461 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
"api_app": &api_app | |
... | |
"client_app": &client_app | |
... |
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
[CRITICAL] Failed to load grains defined in grain file vizibl_config.vizibl_config in function <function vizibl_config at 0x7f09e1c07ed8>, error: | |
Traceback (most recent call last): | |
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 525, in grains | |
ret = fun() | |
File "/var/cache/salt/minion/extmods/grains/vizibl_config.py", line 7, in vizibl_config | |
NameError: global name '__salt__' is not defined |
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
#!/usr/bin/env python | |
def vizibl_config(): | |
grains = {} | |
node_id = __salt__['core.id_']()['id'] | |
if node_id.startswith('prod'): | |
grains['VIZIBL_CONFIG'] = 'Prod' | |
elif node_id.startswith('stage'): | |
grains['VIZIBL_CONFIG'] = 'Stage' | |
elif node_id.startswith('sandbox'): | |
grains['VIZIBL_CONFIG'] = 'Sandbox' | |
elif node_id.startswith('qa'): | |
grains['VIZIBL_CONFIG'] = 'QA' | |
elif node_id.startswith('preprod'): | |
grains['VIZIBL_CONFIG'] = 'PreProd' | |
else: | |
grains['VIZIBL_CONFIG'] = 'Dev' | |
return grains |
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
{% include "pyapps/apps.sls" %} | |
pyapps: | |
"foo": | |
<<: *api_app | |
"bar": | |
<<: *client_app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment