elasticsearch: install a script to help plugins upgrades
This commit is contained in:
parent
70f5504382
commit
54f44f0443
|
@ -24,3 +24,5 @@ elasticsearch_plugin_head_group: "{{ elasticsearch_plugin_head_owner }}"
|
|||
elasticsearch_plugin_head_home: "/home/{{ elasticsearch_plugin_head_owner }}"
|
||||
elasticsearch_plugin_head_clone_dir: "{{ elasticsearch_plugin_head_home }}/www"
|
||||
elasticsearch_plugin_head_tmp_dir: "{{ elasticsearch_plugin_head_home }}/tmp"
|
||||
|
||||
elasticsearch_additional_scripts_dir: /usr/share/scripts
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
# WARNING:
|
||||
# This script is installed and maintained via Ansible. Don't edit directly.
|
||||
# Create a fork if you need changes that can't go into the regular script.
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
PLUGIN_BIN=/usr/share/elasticsearch/bin/elasticsearch-plugin
|
||||
NEED_RESTART=""
|
||||
|
||||
for plugin in $(${PLUGIN_BIN} list | grep -v WARNING); do
|
||||
"${PLUGIN_BIN}" remove "${plugin}"
|
||||
"${PLUGIN_BIN}" install "${plugin}"
|
||||
NEED_RESTART="1"
|
||||
done
|
||||
|
||||
if [ -n "${NEED_RESTART}" ]; then
|
||||
systemctl restart elasticsearch
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
|
||||
- include_role:
|
||||
name: remount-usr
|
||||
when: elasticsearch_additional_scripts_dir | search ("/usr")
|
||||
|
||||
- name: "{{ elasticsearch_additional_scripts_dir }} exists"
|
||||
file:
|
||||
dest: "{{ elasticsearch_additional_scripts_dir }}"
|
||||
mode: "0700"
|
||||
owner: root
|
||||
group: root
|
||||
state: directory
|
||||
|
||||
- name: Plugins upgrade script is installed
|
||||
copy:
|
||||
src: upgrade_elasticsearch_plugins.sh
|
||||
dest: "{{ elasticsearch_additional_scripts_dir }}/upgrade_elasticsearch_plugins.sh"
|
||||
mode: "0755"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
force: yes
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
- include: logs.yml
|
||||
|
||||
- include: additional_scripts.yml
|
||||
|
||||
- include: plugin_head.yml
|
||||
when: elasticsearch_plugin_head
|
||||
|
||||
|
|
Loading…
Reference in New Issue