Support for all xpack features through generic install + improved tests

This commit is contained in:
Dale McDiarmid 2016-07-24 15:25:32 +01:00
parent fdf1bda155
commit 57fa9e432b
11 changed files with 87 additions and 53 deletions

View file

@ -1,41 +1,5 @@
---
#Test if shield is installed
- shell: "{{es_home}}/bin/plugin list | sed -n '1!p' | grep shield"
register: shield_installed
changed_when: False
ignore_errors: yes
environment:
CONF_DIR: "{{ conf_dir }}"
ES_INCLUDE: "{{ instance_default_file }}"
#Remove Shield if installed and its not been requested or the ES version has changed
- name: Remove shield plugin
command: >
{{es_home}}/bin/plugin remove shield
register: xpack_state
failed_when: "'ERROR' in xpack_state.stdout"
changed_when: xpack_state.rc == 0
when: shield_installed.rc == 0 and (not es_enable_xpack or not '"shield" in es_xpack_features' or es_version_changed)
notify: restart elasticsearch
environment:
CONF_DIR: "{{ conf_dir }}"
ES_INCLUDE: "{{ instance_default_file }}"
#Install Shield if not installed, or the es version has changed (so removed above), and its been requested
- name: Install shield plugin
command: >
{{es_home}}/bin/plugin install shield
register: xpack_state
failed_when: "'ERROR' in xpack_state.stdout"
changed_when: xpack_state.rc == 0
when: (shield_installed.rc == 1 or es_version_changed) and es_enable_xpack and '"shield" in es_xpack_features'
notify: restart elasticsearch
environment:
CONF_DIR: "{{ conf_dir }}"
ES_INCLUDE: "{{ instance_default_file }}"
#Shield specific configuration done here
#TODO: 1. Skip users with no password defined or error 2. Passwords | length > 6