From 05a05b5e9b391317acd280b3b1275f0d500daf0e Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Tue, 11 Aug 2020 11:15:57 -0400 Subject: [PATCH] use hostname for cross cluster --- salt/utility/bin/crossthestreams | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/utility/bin/crossthestreams b/salt/utility/bin/crossthestreams index d21e3c1a4..6301a4f71 100644 --- a/salt/utility/bin/crossthestreams +++ b/salt/utility/bin/crossthestreams @@ -1,6 +1,8 @@ #!/bin/bash {% set ES = salt['pillar.get']('manager:mainip', '') %} {%- set MANAGER = salt['grains.get']('master') %} +{% set FEATURES = salt['pillar.get']('elastic:features', False) %} + # Wait for ElasticSearch to come up, so that we can query for version infromation echo -n "Waiting for ElasticSearch..." @@ -35,6 +37,10 @@ echo "Applying cross cluster search config..." {%- if salt['pillar.get']('nodestab', {}) %} {%- for SN, SNDATA in salt['pillar.get']('nodestab', {}).items() %} + {%- if FEATURES is sameas true %} +curl -XPUT http://{{ ES }}:9200/_cluster/settings -H'Content-Type: application/json' -d '{"persistent": {"search": {"remote": {"{{ SN }}": {"skip_unavailable": "true", "seeds": ["{{ SN }}:9300"]}}}}}' + {%- else %} curl -XPUT http://{{ ES }}:9200/_cluster/settings -H'Content-Type: application/json' -d '{"persistent": {"search": {"remote": {"{{ SN }}": {"skip_unavailable": "true", "seeds": ["{{ SNDATA.ip }}:9300"]}}}}}' + {%- endif %} {%- endfor %} {%- endif %}