Add missing update script

This commit is contained in:
phil 2023-05-13 08:36:33 +02:00
parent 9b3913e550
commit 8f22be6f99

View file

@ -0,0 +1,35 @@
#!/bin/sh
# {{ ansible_managed }}
set -eu
OPENSEARCH_BIN_PATH=/usr/share/opensearch/bin
OPENSEARCH_SERVICE=opensearch.service
PLUGINS=(
ingest-attachment
)
ACTION="${1:-help}"
case "$ACTION" in
purge)
for plugin in "${PLUGINS[@]}"; do
$OPENSEARCH_BIN_PATH/opensearch-plugin remove $plugin --batch
done
systemctl restart $OPENSEARCH_SERVICE
;;
install)
for plugin in "${PLUGINS[@]}"; do
$OPENSEARCH_BIN_PATH/opensearch-plugin install $plugin --batch
done
systemctl restart $OPENSEARCH_SERVICE
;;
help)
echo "Syntax: $(basename "$0") { purge | install | help }"
echo
;;
*)
"$0" help >&2
exit 1
;;
esac