Set package on hold after installation

This commit is contained in:
phil 2024-01-21 12:16:59 +01:00
parent 24e959e72c
commit a7fa50096b
3 changed files with 23 additions and 1 deletions

View file

@ -2,3 +2,7 @@ Opensearch
==========
Installation and configuration of [Opensearch](https://opensearch.org/).
Note: After the installation the package will be set on hold. This is because
a packages update fails if additional plugins are installed. These plugins are build
for a single version of opensearch and a restart with a newer version will fail.

View file

@ -13,6 +13,13 @@
- name: "Opensearch | Install opensearch"
ansible.builtin.apt:
name: opensearch
allow_change_held_packages: true
- name: Opensearch | Hold package
ansible.builtin.dpkg_selections:
name: opensearch
selection: hold
when: opensearch_plugins is defined
- name: "Opensearch | Install plugins"
ansible.builtin.command:

View file

@ -32,8 +32,19 @@ case "$ACTION" in
done
systemctl restart $OPENSEARCH_SERVICE
;;
reinstall)
for plugin in "${PLUGINS[@]}"; do
if [ -d "$OPENSEARCH_PLUGIN_PATH/$plugin" ]; then
$OPENSEARCH_BIN_PATH/opensearch-plugin remove $plugin
fi
done
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 "Syntax: $(basename "$0") { purge | install | reinstall | help }"
echo
;;
*)