Re-enabled Fleet Setup during setup

This commit is contained in:
Josh Brower
2023-04-17 15:00:51 -04:00
parent 8cccaef664
commit 31f83c6dee
2 changed files with 7 additions and 7 deletions

View File

@@ -221,8 +221,8 @@ function add_sensor_to_minion() {
function create_fleet_policy() { function create_fleet_policy() {
JSON_STRING=$( jq -n \ JSON_STRING=$( jq -n \
--arg NAME "FleetServer_$MINIONID" \ --arg NAME "FleetServer_$LSHOSTNAME" \
--arg DESC "Fleet Server - $MINIONID" \ --arg DESC "Fleet Server - $LSHOSTNAME" \
'{"name": $NAME,"id":$NAME,"description":$DESC,"namespace":"default","monitoring_enabled":["logs"],"inactivity_timeout":1209600,"has_fleet_server":true}' '{"name": $NAME,"id":$NAME,"description":$DESC,"namespace":"default","monitoring_enabled":["logs"],"inactivity_timeout":1209600,"has_fleet_server":true}'
) )
@@ -230,13 +230,13 @@ function create_fleet_policy() {
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/agent_policies" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING" curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/agent_policies" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
JSON_STRING_UPDATE=$( jq -n \ JSON_STRING_UPDATE=$( jq -n \
--arg NAME "FleetServer_$MINIONID" \ --arg NAME "FleetServer_$LSHOSTNAME" \
--arg DESC "Fleet Server - $MINIONID" \ --arg DESC "Fleet Server - $LSHOSTNAME" \
'{"name":$NAME,"description":$DESC,"namespace":"default","monitoring_enabled":["logs"],"inactivity_timeout":1209600,"data_output_id":"so-manager_elasticsearch"}' '{"name":$NAME,"description":$DESC,"namespace":"default","monitoring_enabled":["logs"],"inactivity_timeout":1209600,"data_output_id":"so-manager_elasticsearch"}'
) )
# Update Fleet Policy - ES Output # Update Fleet Policy - ES Output
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/agent_policies/FleetServer_$MINIONID" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING_UPDATE" curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/agent_policies/FleetServer_$LSHOSTNAME" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING_UPDATE"
} }
function updateMine() { function updateMine() {

View File

@@ -637,8 +637,8 @@ if ! [[ -f $install_opt_file ]]; then
add_web_user add_web_user
info "Restarting SOC to pick up initial user" info "Restarting SOC to pick up initial user"
logCmd "so-soc-restart" logCmd "so-soc-restart"
#title "Setting up Elastic Fleet" title "Setting up Elastic Fleet"
# logCmd "so-elastic-fleet-setup" logCmd "so-elastic-fleet-setup"
if [[ ! $is_import ]]; then if [[ ! $is_import ]]; then
title "Setting up Playbook" title "Setting up Playbook"
logCmd "so-playbook-reset" logCmd "so-playbook-reset"