diff --git a/tasks/elasticsearch-plugins.yml b/tasks/elasticsearch-plugins.yml index b99cfcc..ae53943 100644 --- a/tasks/elasticsearch-plugins.yml +++ b/tasks/elasticsearch-plugins.yml @@ -10,11 +10,6 @@ - set_fact: list_command="--list" when: es_version | version_compare('2.0', '<') -- set_fact: es_binary_prefix="" - -- set_fact: es_binary_prefix="elasticsearch-" - when: es_version | version_compare('5.0', '>=') - #List currently installed plugins - ignore xpack if > v 2.0 - 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 %}" diff --git a/tasks/elasticsearch.yml b/tasks/elasticsearch.yml index 7addb03..71ad9e1 100644 --- a/tasks/elasticsearch.yml +++ b/tasks/elasticsearch.yml @@ -1,5 +1,10 @@ --- +- 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. when: (es_user_id is defined) and (es_group_id is defined) include: elasticsearch-optional-user.yml