fix whitespace control

This commit is contained in:
m0duspwnens
2021-12-16 09:19:20 -05:00
parent a7600f7f43
commit bd7ef1cc59

View File

@@ -322,27 +322,28 @@ output.logstash:
# The Logstash hosts
hosts:
{%- if grains.role in ['so-sensor', 'so-fleet', 'so-node'] -%}
{% set LOGSTASH = namespace() -%}
{% set LOGSTASH.count = 0 -%}
{% set LOGSTASH.loadbalance = false -%}
{% set node_data = salt['pillar.get']('logstash:nodes') -%}
{% for node_type, node_details in node_data.items() | sort -%}
{% if node_type in ['manager', 'managersearch', 'standalone', 'receiver' ] -%}
{% for hostname in node_data[node_type].keys() -%}
{% set LOGSTASH.count = LOGSTASH.count + 1 %}
{%- if grains.role in ['so-sensor', 'so-fleet', 'so-node'] %}
{%- set LOGSTASH = namespace() %}
{%- set LOGSTASH.count = 0 %}
{%- set LOGSTASH.loadbalance = false %}
{%- set node_data = salt['pillar.get']('logstash:nodes') %}
{%- for node_type, node_details in node_data.items() | sort -%}
{%- if node_type in ['manager', 'managersearch', 'standalone', 'receiver' ] %}
{%- for hostname in node_data[node_type].keys() %}
{%- set LOGSTASH.count = LOGSTASH.count + 1 %}
- "{{ hostname }}:5644" #{{ node_details[hostname].ip }}
{%- endfor -%}
{% endif -%}
{% if LOGSTASH.count > 1 -%}
{% set LOGSTASH.loadbalance = true -%}
{% endif -%}
{% endfor %}
{%- endfor %}
{%- endif %}
{%- if LOGSTASH.count > 1 %}
{%- set LOGSTASH.loadbalance = true %}
{%- endif %}
{%- endfor %}
loadbalance: {{ LOGSTASH.loadbalance | lower }}
{% else -%}
{%- else %}
- "{{ grains.host }}:5644"
{% endif %}
{%- endif %}
# Number of workers per Logstash host.
worker: {{ FBLSWORKERS }}