Changes for x-pack installation 5.x

This commit is contained in:
Dale McDiarmid 2017-01-11 13:09:05 +00:00
parent b2dd44e9d5
commit 8772f6d605
2 changed files with 10 additions and 12 deletions

View file

@ -1,23 +1,23 @@
--- ---
#Test if feature is installed #Test if feature is installed
- shell: "{{es_home}}/bin/elasticsearch-plugin list{% if es_version | version_compare('5.0', '<') %} | sed -n '1!p' | cut -d '-' -f2-{% endif %} | grep {{item}}" - shell: "{{es_home}}/bin/elasticsearch-plugin list | grep x-pack"
register: feature_installed register: x_pack_installed
changed_when: False changed_when: False
failed_when: "'ERROR' in feature_installed.stdout" failed_when: "'ERROR' in x_pack_installed.stdout"
ignore_errors: yes ignore_errors: yes
environment: environment:
CONF_DIR: "{{ conf_dir }}" CONF_DIR: "{{ conf_dir }}"
ES_INCLUDE: "{{ instance_default_file }}" ES_INCLUDE: "{{ instance_default_file }}"
#Remove Plugin if installed and its not been requested or the ES version has changed #Remove X-Pack if installed and its not been requested or the ES version has changed
- name: Remove {{item}} plugin - name: Remove x-pack plugin
command: "{{es_home}}/bin/plugin remove {{item}}" command: "{{es_home}}/bin/elasticsearch-plugin remove x-pack"
register: xpack_state register: xpack_state
failed_when: "'ERROR' in xpack_state.stdout" failed_when: "'ERROR' in xpack_state.stdout"
changed_when: xpack_state.rc == 0 changed_when: xpack_state.rc == 0
when: feature_installed.rc == 0 and (not es_enable_xpack or not '"{{item}}" in es_xpack_features' or es_version_changed) when: x_pack_installed.rc == 0 and (not es_enable_xpack or es_version_changed)
notify: restart elasticsearch notify: restart elasticsearch
environment: environment:
CONF_DIR: "{{ conf_dir }}" CONF_DIR: "{{ conf_dir }}"
@ -25,13 +25,13 @@
#Install plugin if not installed, or the es version has changed (so removed above), and its been requested #Install plugin if not installed, or the es version has changed (so removed above), and its been requested
- name: Install {{item}} plugin - name: Install x-pack plugin
command: > command: >
{{es_home}}/bin/elasticsearch-plugin install {{item}} {{es_home}}/bin/elasticsearch-plugin install x-pack
register: xpack_state register: xpack_state
failed_when: "'ERROR' in xpack_state.stdout" failed_when: "'ERROR' in xpack_state.stdout"
changed_when: xpack_state.rc == 0 changed_when: xpack_state.rc == 0
when: (feature_installed.rc == 1 or es_version_changed) and es_enable_xpack and "{{item}}" in es_xpack_features when: (feature_installed.rc == 1 or es_version_changed) and es_enable_xpack
notify: restart elasticsearch notify: restart elasticsearch
environment: environment:
CONF_DIR: "{{ conf_dir }}" CONF_DIR: "{{ conf_dir }}"

View file

@ -42,9 +42,7 @@
CONF_DIR: "{{ conf_dir }}" CONF_DIR: "{{ conf_dir }}"
ES_INCLUDE: "{{ instance_default_file }}" ES_INCLUDE: "{{ instance_default_file }}"
#We loop on all as we may need to remove some features.
- include: elasticsearch-xpack-install.yml - include: elasticsearch-xpack-install.yml
with_items: "{{supported_xpack_features}}"
#Security configuration #Security configuration
- include: security/elasticsearch-security.yml - include: security/elasticsearch-security.yml