Shield now causes restart

This commit is contained in:
Dale McDiarmid 2016-07-23 22:18:31 +01:00
parent 5d3616bd20
commit 4f6d5b0a4a
4 changed files with 16 additions and 14 deletions

View file

@ -1,7 +1,7 @@
- name: restart elasticsearch - name: restart elasticsearch
service: name={{instance_init_script | basename}} state=restarted enabled=yes service: name={{instance_init_script | basename}} state=restarted enabled=yes
when: es_restart_on_change and es_start_service and not elasticsearch_started.changed and ((plugin_installed is defined and plugin_installed.changed) or (elasticsearch_install_from_repo.changed or elasticsearch_install_from_package.changed)) when: es_restart_on_change and es_start_service and not elasticsearch_started.changed and ((plugin_installed is defined and plugin_installed.changed) or (xpack_state.changed) or (elasticsearch_install_from_repo.changed or elasticsearch_install_from_package.changed))
- name: load-native-realms - name: load-native-realms
include: ./handlers/shield/elasticsearch-shield-native.yml include: ./handlers/shield/elasticsearch-shield-native.yml

View file

@ -26,6 +26,7 @@
with_items: "{{ installed_plugins.stdout_lines }}" with_items: "{{ installed_plugins.stdout_lines }}"
when: es_plugins_reinstall and installed_plugins.stdout_lines | length > 0 and not 'No plugin detected' in installed_plugins.stdout_lines[0] when: es_plugins_reinstall and installed_plugins.stdout_lines | length > 0 and not 'No plugin detected' in installed_plugins.stdout_lines[0]
notify: restart elasticsearch notify: restart elasticsearch
register: plugin_installed
environment: environment:
CONF_DIR: "{{ conf_dir }}" CONF_DIR: "{{ conf_dir }}"
ES_INCLUDE: "{{ instance_default_file }}" ES_INCLUDE: "{{ instance_default_file }}"
@ -46,4 +47,5 @@
#Set permissions on plugins directory #Set permissions on plugins directory
- name: Set Plugin Directory Permissions - name: Set Plugin Directory Permissions
file: state=directory path={{ es_home }}/plugins owner={{ es_user }} group={{ es_group }} recurse=yes file: state=directory path={{ es_home }}/plugins owner={{ es_user }} group={{ es_group }} recurse=yes
when: es_enable_xpack

View file

@ -14,9 +14,9 @@
- name: Remove license plugin - name: Remove license plugin
command: > command: >
{{es_home}}/bin/plugin remove license {{es_home}}/bin/plugin remove license
register: license_change register: xpack_state
failed_when: "'ERROR' in license.stdout" failed_when: "'ERROR' in xpack_state.stdout"
changed_when: license_change.rc == 1 changed_when: xpack_state.rc == 0
when: license_installed.rc == 0 and not es_enable_xpack when: license_installed.rc == 0 and not es_enable_xpack
notify: restart elasticsearch notify: restart elasticsearch
environment: environment:
@ -28,9 +28,9 @@
- name: Install license plugin - name: Install license plugin
command: > command: >
{{es_home}}/bin/plugin install license {{es_home}}/bin/plugin install license
register: license_change register: xpack_state
failed_when: "'ERROR' in license_change.stdout" failed_when: "'ERROR' in xpack_state.stdout"
changed_when: license_change.rc == 0 changed_when: xpack_state.rc == 0
when: license_installed.rc == 1 and es_enable_xpack when: license_installed.rc == 1 and es_enable_xpack
notify: restart elasticsearch notify: restart elasticsearch
environment: environment:

View file

@ -14,9 +14,9 @@
- name: Remove shield plugin - name: Remove shield plugin
command: > command: >
{{es_home}}/bin/plugin remove shield {{es_home}}/bin/plugin remove shield
register: shield_change register: xpack_state
failed_when: "'ERROR' in shield_change.stdout" failed_when: "'ERROR' in xpack_state.stdout"
changed_when: shield_change.rc == 0 changed_when: xpack_state.rc == 0
when: shield_installed.rc == 0 and (not es_enable_xpack or not '"shield" in es_xpack_features') when: shield_installed.rc == 0 and (not es_enable_xpack or not '"shield" in es_xpack_features')
notify: restart elasticsearch notify: restart elasticsearch
environment: environment:
@ -28,9 +28,9 @@
- name: Install shield plugin - name: Install shield plugin
command: > command: >
{{es_home}}/bin/plugin install shield {{es_home}}/bin/plugin install shield
register: shield_change register: xpack_state
failed_when: "'ERROR' in shield_change.stdout" failed_when: "'ERROR' in xpack_state.stdout"
changed_when: shield_change.rc == 0 changed_when: xpack_state.rc == 0
when: shield_installed.rc == 1 and es_enable_xpack and '"shield" in es_xpack_features' when: shield_installed.rc == 1 and es_enable_xpack and '"shield" in es_xpack_features'
notify: restart elasticsearch notify: restart elasticsearch
environment: environment: