mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Return adequate exit code when init fails; Logs output of init scripts for troubleshooting failed installations
This commit is contained in:
@@ -123,7 +123,7 @@ cortexscript:
|
|||||||
- source: salt://thehive/scripts/cortex_init
|
- source: salt://thehive/scripts/cortex_init
|
||||||
- cwd: /opt/so
|
- cwd: /opt/so
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- hide_output: True
|
- hide_output: False
|
||||||
|
|
||||||
so-thehive:
|
so-thehive:
|
||||||
docker_container.running:
|
docker_container.running:
|
||||||
@@ -148,7 +148,7 @@ thehivescript:
|
|||||||
- source: salt://thehive/scripts/hive_init
|
- source: salt://thehive/scripts/hive_init
|
||||||
- cwd: /opt/so
|
- cwd: /opt/so
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- hide_output: True
|
- hide_output: False
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ cortex_init(){
|
|||||||
touch /opt/so/state/cortex.txt
|
touch /opt/so/state/cortex.txt
|
||||||
else
|
else
|
||||||
echo "We experienced an issue connecting to Cortex!"
|
echo "We experienced an issue connecting to Cortex!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,10 +66,11 @@ if [ -f /opt/so/state/cortex.txt ]; then
|
|||||||
cortex_clean
|
cortex_clean
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
if wait_for_web_response http://{{MANAGERIP}}:9400 '"status":"green"'; then
|
if wait_for_web_response http://{{MANAGERIP}}:9400/_cluster/health '"status":"green"'; then
|
||||||
cortex_init
|
cortex_init
|
||||||
cortex_clean
|
cortex_clean
|
||||||
else
|
else
|
||||||
echo "TheHive Elasticsearch server is not ready; unable to proceed with cortex init."
|
echo "TheHive Elasticsearch server is not ready; unable to proceed with Cortex init."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ thehive_init(){
|
|||||||
touch /opt/so/state/thehive.txt
|
touch /opt/so/state/thehive.txt
|
||||||
else
|
else
|
||||||
echo "We experienced an issue connecting to TheHive!"
|
echo "We experienced an issue connecting to TheHive!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,10 +44,11 @@ if [ -f /opt/so/state/thehive.txt ]; then
|
|||||||
thehive_clean
|
thehive_clean
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
if wait_for_web_response http://{{MANAGERIP}}:9400 '"status":"green"'; then
|
if wait_for_web_response http://{{MANAGERIP}}:9400/_cluster/health '"status":"green"'; then
|
||||||
thehive_init
|
thehive_init
|
||||||
thehive_clean
|
thehive_clean
|
||||||
else
|
else
|
||||||
echo "TheHive Elasticsearch server is not ready; unable to proceed with hive init."
|
echo "TheHive Elasticsearch server is not ready; unable to proceed with TheHive init."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user