Version 5.0 - no need for plugin prefix

This commit is contained in:
Dale McDiarmid 2017-01-11 10:26:57 +00:00
parent 2d7b851b1f
commit cde17346d5
6 changed files with 9 additions and 14 deletions

View file

@ -12,7 +12,7 @@
#List currently installed plugins - ignore xpack if > v 2.0 #List currently installed plugins - ignore xpack if > v 2.0
- name: Check installed elasticsearch plugins - name: Check installed elasticsearch plugins
shell: "{{es_home}}/bin/{{ es_binary_prefix }}plugin {{list_command}}{% if es_version | version_compare('5.0', '<') %} | sed -n '1!p' | cut -d '-' -f2-{% endif %}{% if es_version | version_compare('2.0', '>') %} | grep -vE '{{supported_xpack_features | join('|')}}|license'{% endif %}" shell: "{{es_home}}/bin/elasticsearch-plugin {{list_command}}{% if es_version | version_compare('5.0', '<') %} | sed -n '1!p' | cut -d '-' -f2-{% endif %}{% if es_version | version_compare('2.0', '>') %} | grep -vE '{{supported_xpack_features | join('|')}}|license'{% endif %}"
register: installed_plugins register: installed_plugins
failed_when: "'ERROR' in installed_plugins.stdout" failed_when: "'ERROR' in installed_plugins.stdout"
changed_when: False changed_when: False
@ -23,7 +23,7 @@
# This removes any currently installed plugins (to prevent errors when reinstalling) # This removes any currently installed plugins (to prevent errors when reinstalling)
- name: Remove elasticsearch plugins - name: Remove elasticsearch plugins
command: "{{es_home}}/bin/{{ es_binary_prefix }}plugin remove {{item}} --silent" command: "{{es_home}}/bin/elasticsearch-plugin remove {{item}} --silent"
ignore_errors: yes ignore_errors: yes
with_items: "{{ installed_plugins.stdout_lines | default([]) }}" with_items: "{{ installed_plugins.stdout_lines | default([]) }}"
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]
@ -35,7 +35,7 @@
- name: Install elasticsearch plugins - name: Install elasticsearch plugins
command: > command: >
{{es_home}}/bin/{{ es_binary_prefix }}plugin install {{ item.plugin }}{% if item.version is defined and item.version != '' %}/{{ item.version }}{% endif %} {% if item.proxy_host is defined and item.proxy_host != '' and item.proxy_port is defined and item.proxy_port != ''%} -DproxyHost={{ item.proxy_host }} -DproxyPort={{ item.proxy_port }} {% elif es_proxy_host is defined and es_proxy_host != '' %} -DproxyHost={{ es_proxy_host }} -DproxyPort={{ es_proxy_port }} {% endif %} --silent {{es_home}}/bin/elasticsearch-plugin install {{ item.plugin }}{% if item.version is defined and item.version != '' %}/{{ item.version }}{% endif %} {% if item.proxy_host is defined and item.proxy_host != '' and item.proxy_port is defined and item.proxy_port != ''%} -DproxyHost={{ item.proxy_host }} -DproxyPort={{ item.proxy_port }} {% elif es_proxy_host is defined and es_proxy_host != '' %} -DproxyHost={{ es_proxy_host }} -DproxyPort={{ es_proxy_port }} {% endif %} --silent
register: plugin_installed register: plugin_installed
failed_when: "'ERROR' in plugin_installed.stdout" failed_when: "'ERROR' in plugin_installed.stdout"
changed_when: plugin_installed.rc == 0 changed_when: plugin_installed.rc == 0

View file

@ -1,10 +1,5 @@
--- ---
- set_fact: es_binary_prefix=""
- set_fact: es_binary_prefix="elasticsearch-"
when: es_version | version_compare('5.0', '>=')
- name: Include optional user and group creation. - name: Include optional user and group creation.
when: (es_user_id is defined) and (es_group_id is defined) when: (es_user_id is defined) and (es_group_id is defined)
include: elasticsearch-optional-user.yml include: elasticsearch-optional-user.yml

View file

@ -1,6 +1,5 @@
--- ---
- set_fact: java_state="present" - set_fact: java_state="present"
- set_fact: java_state="latest" - set_fact: java_state="latest"

View file

@ -13,6 +13,7 @@
when: es_java_install when: es_java_install
tags: tags:
- java - java
- include: elasticsearch.yml - include: elasticsearch.yml
tags: tags:
- install - install

View file

@ -1,7 +1,7 @@
--- ---
#Test if feature is installed #Test if feature is installed
- shell: "{{es_home}}/bin/{{ es_binary_prefix }}plugin list{% if es_version | version_compare('5.0', '<') %} | sed -n '1!p' | cut -d '-' -f2-{% endif %} | grep {{item}}" - shell: "{{es_home}}/bin/elasticsearch-plugin list{% if es_version | version_compare('5.0', '<') %} | sed -n '1!p' | cut -d '-' -f2-{% endif %} | grep {{item}}"
register: feature_installed register: feature_installed
changed_when: False changed_when: False
failed_when: "'ERROR' in feature_installed.stdout" failed_when: "'ERROR' in feature_installed.stdout"
@ -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 {{item}} plugin - name: Install {{item}} plugin
command: > command: >
{{es_home}}/bin/{{ es_binary_prefix }}plugin install {{item}} {{es_home}}/bin/elasticsearch-plugin install {{item}}
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

@ -7,7 +7,7 @@
#Check if license is installed #Check if license is installed
- name: Check License plugin is installed - name: Check License plugin is installed
shell: > shell: >
{{es_home}}/bin/{{ es_binary_prefix }}plugin list | tail -n +2 | grep license {{es_home}}/bin/elasticsearch-plugin list | tail -n +2 | grep license
register: license_installed register: license_installed
ignore_errors: yes ignore_errors: yes
failed_when: "'ERROR' in license_installed.stdout" failed_when: "'ERROR' in license_installed.stdout"
@ -19,7 +19,7 @@
#Remove license if installed and xpack not enabled #Remove license if installed and xpack not enabled
- name: Remove license plugin - name: Remove license plugin
command: > command: >
{{es_home}}/bin/{{ es_binary_prefix }}plugin remove license {{es_home}}/bin/elasticsearch-plugin remove 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
@ -32,7 +32,7 @@
#Install License if not installed, or it needs to be reinstalled due to ES change (above task will have removed), and its been requested. #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/{{ es_binary_prefix }}plugin install license {{es_home}}/bin/elasticsearch-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