Created
May 6, 2014 19:55
-
-
Save erchn/884dacdc2a5028cd4f75 to your computer and use it in GitHub Desktop.
Sharing state information
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
# Get logs from other states | |
{% set mylogs = [] %} | |
{% for myfile in salt['cp.list_master']() %} | |
{% if myfile.split('/')[-1] == "log.incl" %} | |
{% include myfile %} | |
{% endif %} | |
{% endfor %} | |
# {{ mylogs }} |
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
{% if mylogs.append('/var/log/nginx.log') %} | |
{% endif %} |
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
... snip | |
# ['/var/log/nginx.log', '/var/log/unicorn.log'] |
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
{% if mylogs.append('/var/log/unicorn.log') %} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment