disable logstash on heavynodes

This commit is contained in:
m0duspwnens
2024-06-11 13:50:29 -04:00
parent 03335cc015
commit 2ecac38f6d
2 changed files with 16 additions and 2 deletions

View File

@@ -528,7 +528,6 @@ function createHEAVYNODE() {
pcapspace
add_elasticsearch_to_minion
add_elastic_agent_to_minion
add_logstash_to_minion
add_sensor_to_minion
add_strelka_to_minion
add_redis_to_minion

View File

@@ -308,6 +308,21 @@ clone_to_tmp() {
fi
}
disable_logstash_heavynodes() {
c=0
printf "\nChecking for heavynodes and disabling Logstash if they exist\n"
for file in /opt/so/saltstack/local/pillar/minions/*.sls; do
if [[ $file =~ "_heavynode.sls" && ! $file =~ "/opt/so/saltstack/local/pillar/minions/adv_" ]]; then
if [ $c -eq 0 ]; then
((c++))
FINAL_MESSAGE_QUEUE+=("Logstash has been disabled on all heavynodes. It can be re-enabled via Grid Configuration in SOC.")
fi
echo "Disabling Logstash for: $file"
so-yaml.py replace "$file" logstash.enabled False
fi
done
}
enable_highstate() {
echo "Enabling highstate."
salt-call state.enable highstate -l info --local
@@ -477,7 +492,7 @@ post_to_2.4.70() {
}
post_to_2.4.80() {
echo "Nothing to apply"
disable_logstash_heavynodes
POSTVERSION=2.4.80
}