fix loop for node_data

This commit is contained in:
m0duspwnens
2021-12-13 16:26:38 -05:00
parent 6de2f5bd03
commit 067e79894f

View File

@@ -322,13 +322,13 @@ output.logstash:
# The Logstash hosts
hosts:
{%- set LOADBALANCE = ['false'] %}
{%- set node_data = salt['pillar.get']('node_data') | dictsort() %}
{%- if grains.role not in ['so-heavynode', 'so-import', 'so-helix', 'so-eval'] %}
{%- for node_type, node_details in node_data %}
{%- set LOADBALANCE = ['false'] %}
{%- set node_data = salt['pillar.get']('node_data') %}
{%- for node_type, node_details in node_data.items() %}
{%- if node_type in ['manager', 'managersearch', 'standalone', 'receiver' ] %}
{%- for hostname in node_data[node_type].keys() %}
- "{{ hostname }}:5644" #{{ node_details[hostname][ip] }}
- "{{ hostname }}:5644" #{{ node_details[hostname].ip }}
{%- endfor %}
{%- endif %}
{%- if loop.index == 2 %}