make sure fleet-default-output is not set as either default output policy

This commit is contained in:
Jorge Reyes
2025-09-25 09:51:32 -05:00
committed by GitHub
parent 328ac329ec
commit 23e12811a1

View File

@@ -79,7 +79,7 @@ if DEFAULTPOLICY=$(fleet_api "outputs/fleet-default-output"); then
fleet_default=$(echo "$DEFAULTPOLICY" | jq -er '.item.is_default') fleet_default=$(echo "$DEFAULTPOLICY" | jq -er '.item.is_default')
fleet_default_monitoring=$(echo "$DEFAULTPOLICY" | jq -er '.item.is_default_monitoring') fleet_default_monitoring=$(echo "$DEFAULTPOLICY" | jq -er '.item.is_default_monitoring')
# Check that fleet-default-output isn't configured as a default for anything ( both variables return false ) # Check that fleet-default-output isn't configured as a default for anything ( both variables return false )
if [[ $fleet_default ]] && [[ $fleet_default_monitoring ]]; then if [[ ! $fleet_default ]] && [[ ! $fleet_default_monitoring ]]; then
echo -e "\nso-manager_elasticsearch is configured as the current default policy..." echo -e "\nso-manager_elasticsearch is configured as the current default policy..."
else else
echo -e "\nVerification of so-manager_elasticsearch policy failed... The default 'fleet-default-output' output is still active..." echo -e "\nVerification of so-manager_elasticsearch policy failed... The default 'fleet-default-output' output is still active..."