X-Pack fixes - no more license file needed

This commit is contained in:
Dale McDiarmid 2017-01-16 12:04:10 +00:00
parent 3218191ee0
commit 719bd67fde
3 changed files with 2 additions and 43 deletions

View file

@ -27,7 +27,7 @@
#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 x-pack plugin - name: Install x-pack plugin
command: > command: >
{{es_home}}/bin/elasticsearch-plugin install --batch x-pack {% if es_proxy_host is defined and es_proxy_host != '' %} -Dhttp.proxyHost={{ es_proxy_host }} -Dhttp.proxyPort={{ es_proxy_port }} {% endif %} {{es_home}}/bin/elasticsearch-plugin install --silent --batch x-pack {% if es_proxy_host is defined and es_proxy_host != '' %} -Dhttp.proxyHost={{ es_proxy_host }} -Dhttp.proxyPort={{ es_proxy_port }} {% endif %}
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

View file

@ -2,46 +2,6 @@
- set_fact: es_version_changed={{ ((elasticsearch_install_from_package is defined and (debian_elasticsearch_install_from_repo.changed or redhat_elasticsearch_install_from_repo.changed)) or (elasticsearch_install_from_package is defined and elasticsearch_install_from_package.changed)) }} - set_fact: es_version_changed={{ ((elasticsearch_install_from_package is defined and (debian_elasticsearch_install_from_repo.changed or redhat_elasticsearch_install_from_repo.changed)) or (elasticsearch_install_from_package is defined and elasticsearch_install_from_package.changed)) }}
#enabling xpack installs the license. Not a xpack feature and does not need to be specified - TODO: we should append it to the list if xpack is enabled and remove this
#Check if license is installed
- name: Check License plugin is installed
shell: >
{{es_home}}/bin/elasticsearch-plugin list | tail -n +2 | grep license
register: license_installed
ignore_errors: yes
failed_when: "'ERROR' in license_installed.stdout"
changed_when: False
environment:
CONF_DIR: "{{ conf_dir }}"
ES_INCLUDE: "{{ instance_default_file }}"
#Remove license if installed and xpack not enabled
- name: Remove license plugin
command: >
{{es_home}}/bin/elasticsearch-plugin remove license
register: xpack_state
failed_when: "'ERROR' in xpack_state.stdout"
changed_when: xpack_state.rc == 0
when: license_installed.rc == 0 and (not es_enable_xpack or es_version_changed)
notify: restart elasticsearch
environment:
CONF_DIR: "{{ conf_dir }}"
ES_INCLUDE: "{{ instance_default_file }}"
#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
command: >
{{es_home}}/bin/elasticsearch-plugin install license
register: xpack_state
failed_when: "'ERROR' in xpack_state.stdout"
changed_when: xpack_state.rc == 0
when: (license_installed.rc == 1 or es_version_changed) and es_enable_xpack
notify: restart elasticsearch
environment:
CONF_DIR: "{{ conf_dir }}"
ES_INCLUDE: "{{ instance_default_file }}"
- include: elasticsearch-xpack-install.yml - include: elasticsearch-xpack-install.yml
#Security configuration #Security configuration

View file

@ -10,8 +10,7 @@
es_enable_xpack: true es_enable_xpack: true
es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}" es_xpack_license: "{{ lookup('file', '/tmp/license.json') }}"
es_plugins: es_plugins:
- plugin: lmenezes/elasticsearch-kopf - plugin: ingest-geoip
version: master
es_xpack_features: es_xpack_features:
- security - security
- alerting - alerting