Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get salt pillars from a specific grain
{% 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
You can’t perform that action at this time.