Add missing update script
This commit is contained in:
parent
9b3913e550
commit
8f22be6f99
1 changed files with 35 additions and 0 deletions
35
templates/update-opensearch-plugins.j2
Normal file
35
templates/update-opensearch-plugins.j2
Normal 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
|
Loading…
Reference in a new issue