Change shield versions if ES changes version
This commit is contained in:
parent
4f6d5b0a4a
commit
048fd63602
3 changed files with 16 additions and 15 deletions
|
|
@ -1,4 +1,7 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
|
- set_fact: es_version_changed=((elasticsearch_install_from_package is defined and elasticsearch_install_from_repo.changed) or (elasticsearch_install_from_package is defined and elasticsearch_install_from_package.changed))
|
||||||
|
|
||||||
#Check if license is installed
|
#Check if license is installed
|
||||||
- name: Check License is installed
|
- name: Check License is installed
|
||||||
shell: >
|
shell: >
|
||||||
|
|
@ -17,27 +20,27 @@
|
||||||
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: license_installed.rc == 0 and not es_enable_xpack
|
when: license_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 }}"
|
||||||
ES_INCLUDE: "{{ instance_default_file }}"
|
ES_INCLUDE: "{{ instance_default_file }}"
|
||||||
|
|
||||||
|
|
||||||
#Install License if not installed
|
#Install License if not installed, or it needs to be reinstalled due to ES change (above task will have removed), and its been requested.
|
||||||
- name: Install license plugin
|
- name: Install license plugin
|
||||||
command: >
|
command: >
|
||||||
{{es_home}}/bin/plugin install license
|
{{es_home}}/bin/plugin install license
|
||||||
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: license_installed.rc == 1 and es_enable_xpack
|
when: (license_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 }}"
|
||||||
ES_INCLUDE: "{{ instance_default_file }}"
|
ES_INCLUDE: "{{ instance_default_file }}"
|
||||||
|
|
||||||
#Include shield as we may need to remove it
|
#Include shield as we may need to remove it or change it due to es_version_changed
|
||||||
- include: shield/elasticsearch-shield.yml
|
- include: shield/elasticsearch-shield.yml
|
||||||
# when: '"shield" in es_xpack_features'
|
# when: '"shield" in es_xpack_features'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
---
|
---
|
||||||
|
- set_fact: manage_file_users=es_users is defined and es_users.file is defined
|
||||||
- set_fact: manage_file_users=false
|
|
||||||
|
|
||||||
- set_fact: manage_file_users=true
|
|
||||||
when: es_users is defined and es_users.file is defined
|
|
||||||
|
|
||||||
#List current users
|
#List current users
|
||||||
- name: List Users
|
- name: List Users
|
||||||
|
|
|
||||||
|
|
@ -10,28 +10,28 @@
|
||||||
ES_INCLUDE: "{{ instance_default_file }}"
|
ES_INCLUDE: "{{ instance_default_file }}"
|
||||||
|
|
||||||
|
|
||||||
#Remove Shield if installed and its not been requested
|
#Remove Shield if installed and its not been requested or the ES version has changed
|
||||||
- name: Remove shield plugin
|
- name: Remove shield plugin
|
||||||
command: >
|
command: >
|
||||||
{{es_home}}/bin/plugin remove shield
|
{{es_home}}/bin/plugin remove shield
|
||||||
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: 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' or es_version_changed)
|
||||||
notify: restart elasticsearch
|
notify: restart elasticsearch
|
||||||
environment:
|
environment:
|
||||||
CONF_DIR: "{{ conf_dir }}"
|
CONF_DIR: "{{ conf_dir }}"
|
||||||
ES_INCLUDE: "{{ instance_default_file }}"
|
ES_INCLUDE: "{{ instance_default_file }}"
|
||||||
|
|
||||||
|
|
||||||
#Install Shield if not installed and its been requested
|
#Install Shield if not installed, or the es version has changed (so removed above), and its been requested
|
||||||
- name: Install shield plugin
|
- name: Install shield plugin
|
||||||
command: >
|
command: >
|
||||||
{{es_home}}/bin/plugin install shield
|
{{es_home}}/bin/plugin install shield
|
||||||
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: shield_installed.rc == 1 and es_enable_xpack and '"shield" in es_xpack_features'
|
when: (shield_installed.rc == 1 or es_version_changed) and es_enable_xpack and '"shield" in es_xpack_features'
|
||||||
notify: restart elasticsearch
|
notify: restart elasticsearch
|
||||||
environment:
|
environment:
|
||||||
CONF_DIR: "{{ conf_dir }}"
|
CONF_DIR: "{{ conf_dir }}"
|
||||||
|
|
@ -42,13 +42,15 @@
|
||||||
#-----------------------------FILE BASED REALM----------------------------------------
|
#-----------------------------FILE BASED REALM----------------------------------------
|
||||||
|
|
||||||
- include: elasticsearch-shield-file.yml
|
- include: elasticsearch-shield-file.yml
|
||||||
when: (es_users is defined and es_users.file) or (es_roles is defined and es_roles.file is defined)
|
when: (es_enable_xpack and '"shield" in es_xpack_features') and ((es_users is defined and es_users.file) or (es_roles is defined and es_roles.file is defined))
|
||||||
|
|
||||||
#-----------------------------NATIVE BASED REALM----------------------------------------
|
#-----------------------------NATIVE BASED REALM----------------------------------------
|
||||||
# The native realm requires the node to be started so we do as a handler
|
# The native realm requires the node to be started so we do as a handler
|
||||||
- command: /bin/true
|
- command: /bin/true
|
||||||
notify: load-native-realms
|
notify: load-native-realms
|
||||||
when: (es_users is defined and es_users.native is defined) or (es_roles is defined and es_roles.native is defined)
|
when: (es_enable_xpack and '"shield" in es_xpack_features') and ((es_users is defined and es_users.native is defined) or (es_roles is defined and es_roles.native is defined))
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------
|
||||||
|
|
||||||
#Ensure shield conf directory is created
|
#Ensure shield conf directory is created
|
||||||
- name: Ensure shield conf directory exists
|
- name: Ensure shield conf directory exists
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue