From 95edae40eaf3e74e9e291abc15378a13692a58ef Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Thu, 11 Oct 2018 22:56:33 -0400 Subject: [PATCH] Utility Module - Rework cluster settings --- pillar/data/addtotab.sh | 6 +++--- pillar/data/nodestab.sls | 2 -- salt/logstash/files/dynamic/9999_output_redis.conf | 1 + salt/utility/bin/crossthestreams.sh | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pillar/data/addtotab.sh b/pillar/data/addtotab.sh index db1b35179..22dcab221 100644 --- a/pillar/data/addtotab.sh +++ b/pillar/data/addtotab.sh @@ -6,10 +6,10 @@ TYPE=$1 NAME=$2 IPADDRESS=$3 -if grep -q $3 "/opt/so/saltstack/pillar/data/$1.sls"; then +if grep -q $IPADDRESS "/opt/so/saltstack/pillar/data/$TYPE.sls"; then echo "Storage Node Already in There" else - echo " $2:" >> /opt/so/saltstack/pillar/data/$1.sls - echo " - $3" >> /opt/so/saltstack/pillar/data/$1.sls + echo " $NAME:" >> /opt/so/saltstack/pillar/data/$NAME.sls + echo " ip: $IPADDRESS" >> /opt/so/saltstack/pillar/data/$NAME.sls fi diff --git a/pillar/data/nodestab.sls b/pillar/data/nodestab.sls index 776c52e6e..b30173cca 100644 --- a/pillar/data/nodestab.sls +++ b/pillar/data/nodestab.sls @@ -1,3 +1 @@ nodestab: - - diff --git a/salt/logstash/files/dynamic/9999_output_redis.conf b/salt/logstash/files/dynamic/9999_output_redis.conf index 1769c651c..2748209ea 100644 --- a/salt/logstash/files/dynamic/9999_output_redis.conf +++ b/salt/logstash/files/dynamic/9999_output_redis.conf @@ -3,6 +3,7 @@ {%- set nodetype = 'master' %} {%- else %} {%- set nodetype = salt['pillar.get']('node:node_type', 'storage') %} +{%- set master = grains['master'] %} {%- endif %} output { redis { diff --git a/salt/utility/bin/crossthestreams.sh b/salt/utility/bin/crossthestreams.sh index 5997f985e..63859d9e9 100644 --- a/salt/utility/bin/crossthestreams.sh +++ b/salt/utility/bin/crossthestreams.sh @@ -31,5 +31,5 @@ echo "Applying cross cluster search config..." # Add all the storage nodes to cross cluster searching. {%- for SN, SNIP in salt['pillar.get']('nodestab', {}).iteritems() %}} -curl -XPUT http://{{ ES }}:9200/_cluster/settings -H'Content-Type: application/json' -d '{"persistent": {"search": {"remote": {"{{ SN }}": {"skip_unavailable": "true", "seeds": ["{{ SNIP }}:9200"]}}}}}' +curl -XPUT http://{{ ES }}:9200/_cluster/settings -H'Content-Type: application/json' -d '{"persistent": {"search": {"remote": {"{{ SN }}": {"skip_unavailable": "true", "seeds": ["{{ SNIP['ip'] }}:9300"]}}}}}' {%- endfor %}