diff --git a/salt/elasticfleet/tools/sbin/so-elastic-fleet-common b/salt/elasticfleet/tools/sbin/so-elastic-fleet-common index 3a35c4c0c..777e79921 100644 --- a/salt/elasticfleet/tools/sbin/so-elastic-fleet-common +++ b/salt/elasticfleet/tools/sbin/so-elastic-fleet-common @@ -66,7 +66,7 @@ elastic_fleet_active_enrollment_token() { TOKEN_COUNT=$(jq --arg pid "$POLICY_ID" '[.list[] | select(.policy_id == $pid and .active == true)] | length' <<<"$RESP") - if [ "$TOKEN_COUNT" -eq 0 ]; then + if [ "${TOKEN_COUNT:-0}" -eq 0 ]; then echo "Error: No active enrollment token found for agent policy '$POLICY_ID'." >&2 return 1 fi @@ -166,7 +166,7 @@ elastic_fleet_integration_check() { JSON_STRING=$2 - NAME=$(jq -r .name $JSON_STRING) + NAME=$(jq -r .name "$JSON_STRING") INTEGRATION_ID="" local POLICY_JSON diff --git a/salt/elasticfleet/tools/sbin/so-elastic-fleet-integration-policy-load b/salt/elasticfleet/tools/sbin/so-elastic-fleet-integration-policy-load index 57569b56b..7c2aeb006 100644 --- a/salt/elasticfleet/tools/sbin/so-elastic-fleet-integration-policy-load +++ b/salt/elasticfleet/tools/sbin/so-elastic-fleet-integration-policy-load @@ -10,10 +10,6 @@ RETURN_CODE=0 if [ ! -f /opt/so/state/eaintegrations.txt ]; then - for AGENT_POLICY in endpoints-initial so-grid-nodes_general so-grid-nodes_heavy; do - elastic_fleet_require_agent_policy "$AGENT_POLICY" >/dev/null || exit 1 - done - # update Fleet Server policies /usr/sbin/so-elastic-fleet-integration-policy-elastic-fleet-server