diff --git a/elasticsearch/jvmopts.sls b/elasticsearch/jvmopts.sls index 683d9c1..2e5bf9e 100644 --- a/elasticsearch/jvmopts.sls +++ b/elasticsearch/jvmopts.sls @@ -3,7 +3,7 @@ include: {% from "elasticsearch/settings.sls" import elasticsearch with context %} -{%- if elasticsearch.major_version == 5 or elasticsearch.major_version == 6 %} +{% if elasticsearch.major_version >= 5 %} {%- set jvm_opts = salt['pillar.get']('elasticsearch:jvm_opts') %} {%- if jvm_opts %} /etc/elasticsearch/jvm.options: diff --git a/elasticsearch/plugins.sls b/elasticsearch/plugins.sls index 9c5fcf7..6fabb45 100644 --- a/elasticsearch/plugins.sls +++ b/elasticsearch/plugins.sls @@ -4,7 +4,7 @@ include: {% from "elasticsearch/settings.sls" import elasticsearch with context %} {%- set plugins_pillar = salt['pillar.get']('elasticsearch:plugins', {}) %} -{% if elasticsearch.major_version == 5 or elasticsearch.major_version == 6 %} +{% if elasticsearch.major_version >= 5 %} {%- set plugin_bin = 'elasticsearch-plugin' %} {% else %} {%- set plugin_bin = 'plugin' %} diff --git a/elasticsearch/repo.sls b/elasticsearch/repo.sls index ed4fc93..554e8cd 100644 --- a/elasticsearch/repo.sls +++ b/elasticsearch/repo.sls @@ -1,14 +1,12 @@ {% from "elasticsearch/settings.sls" import elasticsearch with context %} -{%- if elasticsearch.major_version == 6 %} - {%- set repo_url = 'https://artifacts.elastic.co/packages/6.x' %} -{%- elif elasticsearch.major_version == 5 %} - {%- set repo_url = 'https://artifacts.elastic.co/packages/5.x' %} +{%- if elasticsearch.major_version >= 5 %} + {%- set repo_url = 'https://artifacts.elastic.co/packages/' ~ (elasticsearch.major_version|string) ~ '.x' %} {%- else %} {%- set repo_url = 'http://packages.elastic.co/elasticsearch/2.x' %} {%- endif %} -{%- if elasticsearch.major_version == 5 and grains['os_family'] == 'Debian' %} +{%- if elasticsearch.major_version >= 5 and grains['os_family'] == 'Debian' %} apt-transport-https: pkg.installed {%- endif %} @@ -17,7 +15,7 @@ elasticsearch_repo: pkgrepo.managed: - humanname: Elasticsearch {{ elasticsearch.major_version }} {%- if grains.get('os_family') == 'Debian' %} - {%- if elasticsearch.major_version == 5 %} + {%- if elasticsearch.major_version >= 5 %} - name: deb {{ repo_url }}/apt stable main {%- else %} - name: deb {{ repo_url }}/debian stable main @@ -29,7 +27,7 @@ elasticsearch_repo: - clean_file: true {%- elif grains['os_family'] == 'RedHat' %} - name: elasticsearch - {%- if elasticsearch.major_version == 5 %} + {%- if elasticsearch.major_version >= 5 %} - baseurl: {{ repo_url }}/yum {%- else %} - baseurl: {{ repo_url }}/centos