reorder fleet package / policy installation & upgrade

This commit is contained in:
reyesj2
2026-08-26 13:56:23 -05:00
parent 9a92c6cbd7
commit 02ed1d8f78
2 changed files with 22 additions and 0 deletions
+11
View File
@@ -76,6 +76,16 @@ so-elastic-fleet-integrations:
interval: 10
- require:
- http: wait_for_so-kibana
- cmd: so-elastic-fleet-package-upgrade
so-elastic-fleet-package-upgrade-verify:
cmd.run:
- name: /usr/sbin/so-elastic-fleet-package-upgrade
- retry:
attempts: 3
interval: 30
- require:
- cmd: so-elastic-fleet-integration-upgrade
so-elastic-agent-grid-upgrade:
cmd.run:
@@ -94,6 +104,7 @@ so-elastic-fleet-integration-upgrade:
interval: 10
- require:
- http: wait_for_so-kibana
- cmd: so-elastic-fleet-integrations
{# Optional integrations script doesn't need the retries like so-elastic-fleet-integration-upgrade which loads the default integrations #}
so-elastic-fleet-addon-integrations:
@@ -21,6 +21,17 @@ if INSTALLED_VERSION=$(elastic_fleet_package_version_check "{{ PACKAGE }}") && L
if ! elastic_fleet_package_install "{{ PACKAGE }}" "$LATEST_VERSION"; then
PKG_LOAD_FAILURES=$((PKG_LOAD_FAILURES + 1))
PKG_LOAD_FAILURES_NAMES+=("{{ PACKAGE }}")
# check that package has upgraded to the expected version after install command
elif ! LATEST_VERSION=$(elastic_fleet_package_latest_version_check "{{ PACKAGE }}"); then
echo "ERROR: Failed to get latest version information for integration {{ PACKAGE }} after upgrade attempt"
PKG_LOAD_FAILURES=$((PKG_LOAD_FAILURES + 1))
PKG_LOAD_FAILURES_NAMES+=("{{ PACKAGE }}")
elif INSTALLED_VERSION=$(elastic_fleet_package_version_check "{{ PACKAGE }}") && [ "$INSTALLED_VERSION" == "$LATEST_VERSION" ]; then
echo "{{ PACKAGE }} integration upgraded to version $LATEST_VERSION."
else
echo "ERROR: {{ PACKAGE }} integration still at ${INSTALLED_VERSION:-unknown}; expected $LATEST_VERSION"
PKG_LOAD_FAILURES=$((PKG_LOAD_FAILURES + 1))
PKG_LOAD_FAILURES_NAMES+=("{{ PACKAGE }}")
fi
fi
else