Force package installation

This commit is contained in:
Wes
2023-08-16 20:10:20 +00:00
parent 16da0b469a
commit e84d624d23
2 changed files with 4 additions and 3 deletions

View File

@@ -62,8 +62,9 @@ elastic_fleet_package_latest_version_check() {
} }
elastic_fleet_package_install() { elastic_fleet_package_install() {
PKGKEY=$1 PKG=$1
curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X POST -H 'kbn-xsrf: true' "localhost:5601/api/fleet/epm/packages/$PKGKEY" VERSION=$2
curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X POST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{"force":true}' "localhost:5601/api/fleet/epm/packages/$PKG/$VERSION"
} }
elastic_fleet_package_is_installed() { elastic_fleet_package_is_installed() {

View File

@@ -11,7 +11,7 @@
{%- for PACKAGE in SUPPORTED_PACKAGES %} {%- for PACKAGE in SUPPORTED_PACKAGES %}
echo "Upgrading {{ PACKAGE }} package..." echo "Upgrading {{ PACKAGE }} package..."
VERSION=$(elastic_fleet_package_latest_version_check "{{ PACKAGE }}") VERSION=$(elastic_fleet_package_latest_version_check "{{ PACKAGE }}")
elastic_fleet_package_install "{{ PACKAGE }}-$VERSION" elastic_fleet_package_install "{{ PACKAGE }}" "$VERSION"
echo echo
{%- endfor %} {%- endfor %}
echo echo