mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Utility Module - Rework cluster settings
This commit is contained in:
@@ -6,10 +6,10 @@ TYPE=$1
|
|||||||
NAME=$2
|
NAME=$2
|
||||||
IPADDRESS=$3
|
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"
|
echo "Storage Node Already in There"
|
||||||
else
|
else
|
||||||
echo " $2:" >> /opt/so/saltstack/pillar/data/$1.sls
|
echo " $NAME:" >> /opt/so/saltstack/pillar/data/$NAME.sls
|
||||||
echo " - $3" >> /opt/so/saltstack/pillar/data/$1.sls
|
echo " ip: $IPADDRESS" >> /opt/so/saltstack/pillar/data/$NAME.sls
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
nodestab:
|
nodestab:
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
{%- set nodetype = 'master' %}
|
{%- set nodetype = 'master' %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set nodetype = salt['pillar.get']('node:node_type', 'storage') %}
|
{%- set nodetype = salt['pillar.get']('node:node_type', 'storage') %}
|
||||||
|
{%- set master = grains['master'] %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
output {
|
output {
|
||||||
redis {
|
redis {
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ echo "Applying cross cluster search config..."
|
|||||||
|
|
||||||
# Add all the storage nodes to cross cluster searching.
|
# Add all the storage nodes to cross cluster searching.
|
||||||
{%- for SN, SNIP in salt['pillar.get']('nodestab', {}).iteritems() %}}
|
{%- 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 %}
|
{%- endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user