Merge branch 'xpack' of https://github.com/nullkarma/ansible-elasticsearch into nullkarma-xpack

This commit is contained in:
Dale McDiarmid 2017-08-18 19:38:16 +01:00
commit 3a0940fcb7
3 changed files with 31 additions and 4 deletions

View file

@ -27,7 +27,7 @@ es_max_threads: 2048
es_max_map_count: 262144 es_max_map_count: 262144
es_allow_downgrades: false es_allow_downgrades: false
es_enable_xpack: false es_enable_xpack: false
es_xpack_features: ["alerting","monitoring","graph","security"] es_xpack_features: ["alerting","monitoring","graph","ml","security"]
#These are used for internal operations performed by ansible. #These are used for internal operations performed by ansible.
#They do not effect the current configuration #They do not effect the current configuration
es_api_host: "localhost" es_api_host: "localhost"

View file

@ -26,13 +26,32 @@
#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: Download x-pack from url
get_url: url={{ es_xpack_custom_url }} dest=/tmp/x-pack-{{ es_version }}.zip
when: (x_pack_installed.rc == 1 or es_version_changed) and (es_enable_xpack and es_xpack_custom_url is defined)
- name: Install x-pack plugin from local
command: >
{{es_home}}/bin/elasticsearch-plugin install --silent --batch file:///tmp/x-pack-{{ es_version }}.zip
register: xpack_state
changed_when: xpack_state.rc == 0
when: (x_pack_installed.rc == 1 or es_version_changed) and (es_enable_xpack and es_xpack_custom_url is defined)
notify: restart elasticsearch
environment:
CONF_DIR: "{{ conf_dir }}"
ES_INCLUDE: "{{ instance_default_file }}"
- name: Delete x-pack zip file
file: dest=/tmp/x-pack-{{ es_version }}.zip state=absent
when: es_xpack_custom_url is defined
- name: Install x-pack plugin from elastic.co
command: > command: >
{{es_home}}/bin/elasticsearch-plugin install --silent --batch x-pack {{es_home}}/bin/elasticsearch-plugin install --silent --batch 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: (x_pack_installed.rc == 1 or es_version_changed) and es_enable_xpack when: (x_pack_installed.rc == 1 or es_version_changed) and (es_enable_xpack and es_xpack_custom_url is not defined)
notify: restart elasticsearch notify: restart elasticsearch
environment: environment:
CONF_DIR: "{{ conf_dir }}" CONF_DIR: "{{ conf_dir }}"

View file

@ -31,3 +31,11 @@ xpack.monitoring.enabled: false
{% if not "alerting" in es_xpack_features %} {% if not "alerting" in es_xpack_features %}
xpack.watcher.enabled: false xpack.watcher.enabled: false
{% endif %} {% endif %}
{% if not "ml" in es_xpack_features %}
xpack.ml.enabled: false
{% endif %}
{% if not "graph" in es_xpack_features %}
xpack.graph.enabled: false
{% endif %}