diff --git a/salt/filebeat/etc/filebeat.yml b/salt/filebeat/etc/filebeat.yml index 0c27e3c1b..02c094f80 100644 --- a/salt/filebeat/etc/filebeat.yml +++ b/salt/filebeat/etc/filebeat.yml @@ -321,7 +321,19 @@ output.logstash: enabled: true # The Logstash hosts - hosts: ["{{ MANAGER }}:5644"] + hosts: +{%- set LOADBALANCE = ['false'] %} +{%- if grains.role not in ['so-heavynode', 'so-import', 'so-helix', 'so-eval'] %} +{%- for minionid, ip in salt['mine.get']('G@role:so-standalone or G@role:so-manager or G@role:so-managersearch or G@role:so-receiver', 'network.ip_addrs', tgt_type='compound') | dictsort() %} + - "{{ minionid.split('_')[0] }}:5644" #{{ ip[0] }} +{%- if loop.index == 2 %} +{%- do LOADBALANCE.insert(0, 'true') %} +{%- endif %} +{%- endfor %} + loadbalance: {{ LOADBALANCE[0] }} +{%- else %} + - "{{ grains.host }}:5644" +{%- endif %} # Number of workers per Logstash host. worker: {{ FBLSWORKERS }} diff --git a/salt/salt/minion.sls b/salt/salt/minion.sls index 22ea149bf..38f8889c3 100644 --- a/salt/salt/minion.sls +++ b/salt/salt/minion.sls @@ -82,7 +82,7 @@ salt_minion_service_unit_file: mine_functions: file.managed: - name: /etc/salt/minion.d/mine_functions.conf - - source: salt://salt/etc/mine_functions.conf + - source: salt://salt/etc/minion.d/mine_functions.conf - template: jinja # this has to be outside the if statement above since there are _in calls to this state