diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 42ea7e764..67b291ddf 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -529,6 +529,24 @@ up_to_2.4.20() { } up_to_2.4.30() { + + # Remove older defend integration json + rm -f /opt/so/conf/elastic-fleet/integrations/endpoints-initial/elastic-defend-endpoints.json + . /usr/sbin/so-elastic-fleet-common + + echo "Checking to make sure that Kibana API is up & ready..." + RETURN_CODE=0 + wait_for_web_response "http://localhost:5601/api/fleet/settings" "fleet" 300 "curl -K /opt/so/conf/elasticsearch/curl.config" + RETURN_CODE=$? + if [[ "$RETURN_CODE" != "0" ]]; then + echo "Kibana API not accessible, exiting script..." + exit 1 + fi + + elastic_fleet_integration_remove endpoints-initial elastic-defend-endpoints + /usr/sbin/so-elastic-fleet-integration-policy-elastic-defend + + # Elastic Update for this release, so download Elastic Agent files determine_elastic_agent_upgrade rm -f /opt/so/state/estemplates*.txt @@ -735,8 +753,23 @@ apply_hotfix() { . /usr/sbin/so-elastic-fleet-common elastic_fleet_integration_remove endpoints-initial elastic-defend-endpoints /usr/sbin/so-elastic-fleet-integration-policy-elastic-defend -# elif [[ "$INSTALLEDVERSION" == "2.3.110" ]] ; then -# 2_3_10_hotfix_1 + elif [[ "$INSTALLEDVERSION" == "2.4.30" ]] ; then + rm -f /opt/so/conf/elastic-fleet/integrations/endpoints-initial/elastic-defend-endpoints.json + so-kibana-restart --force + . /usr/sbin/so-elastic-fleet-common + + echo "Checking to make sure that Kibana API is up & ready..." + RETURN_CODE=0 + wait_for_web_response "http://localhost:5601/api/fleet/settings" "fleet" 300 "curl -K /opt/so/conf/elasticsearch/curl.config" + RETURN_CODE=$? + if [[ "$RETURN_CODE" != "0" ]]; then + echo "Kibana API not accessible, exiting script..." + exit 1 + fi + + elastic_fleet_integration_remove endpoints-initial elastic-defend-endpoints + /usr/sbin/so-elastic-fleet-integration-policy-elastic-defend + salt-call state.highstate else echo "No actions required. ($INSTALLEDVERSION/$HOTFIXVERSION)" fi