Set package on hold after installation
This commit is contained in:
parent
24e959e72c
commit
a7fa50096b
3 changed files with 23 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
;;
|
||||
*)
|
||||
|
|
Loading…
Reference in a new issue