add error checking and retries for elastic_fleet_installed_packages & associated script

This commit is contained in:
reyesj2
2025-09-17 14:59:13 -05:00
parent 3e16bc8335
commit d0e875928d
2 changed files with 6 additions and 3 deletions

View File

@@ -125,7 +125,9 @@ elastic_fleet_bulk_package_install() {
}
elastic_fleet_installed_packages() {
curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET -H 'kbn-xsrf: true' -H 'Content-Type: application/json' "localhost:5601/api/fleet/epm/packages/installed?perPage=500"
if ! curl -sK /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET -H 'kbn-xsrf: true' -H 'Content-Type: application/json' "localhost:5601/api/fleet/epm/packages/installed?perPage=500" --retry 3 --fail 2>/dev/null; then
return 1
fi
}
elastic_fleet_agent_policy_ids() {