Created
September 12, 2014 17:55
-
-
Save brianz/49268215a97db36d0135 to your computer and use it in GitHub Desktop.
Get salt pillars from a specific grain
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 instance_type = grains.get('instance_type', '') %} | |
{% set logstash_servers = salt['pillar.get'](instance_type + ':logstash_servers') %} | |
{% set logstash_paths = salt['pillar.get'](instance_type + ':logstash_paths') %} | |
{% set logstash_fields = salt['pillar.get'](instance_type + ':logstash_fields') %} | |
{% if logstash_servers and logstash_paths and logstash_fields %} | |
{ | |
"network": { | |
"servers": {{ logstash_servers|json }} | |
, "ssl ca": "/etc/pki/tls/certs/logstash.crt" | |
} | |
, "files": [ | |
{ | |
"paths": {{ logstash_paths|json }} | |
, "fields": {{ logstash_fields|json }} | |
} | |
] | |
}{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment