geerlingguy / ansible-role-elasticsearch

Ansible Role - Elasticsearch
https://galaxy.ansible.com/geerlingguy/elasticsearch/
MIT License
185 stars 208 forks source link

Elasticsearch 1.x #26

Closed tripox closed 7 years ago

tripox commented 8 years ago

The most 'stable' release of the Drupal module, Elasticsearch Connector, requires Elasticsearch 1.x installed.

It would be nice to have an option between Elasticsearch 1.x and 2.x.

I'm not sure if this feature request belongs here or on geerlingguy/drupal-vm.

geerlingguy commented 8 years ago

@tripox - It would be best to have an issue in this queue, since the ability to specify a version would have to be controlled by this Ansible role.

It might not be too hard to allow the choice between the two (though some configuration might need to change with a version difference).

prydie commented 8 years ago

torchbox/wagtail also requires 1.x so :+1: for multi-version support.

korzh-nick commented 7 years ago
diff --git a/provisioning/roles/geerlingguy.elasticsearch/defaults/main.yml b/provisioning/roles/geerlingguy.elasticsearch/defaults/main.yml
index 758877f..e27808a 100644
--- a/provisioning/roles/geerlingguy.elasticsearch/defaults/main.yml
+++ b/provisioning/roles/geerlingguy.elasticsearch/defaults/main.yml
@@ -3,3 +3,4 @@ elasticsearch_network_host: localhost
 elasticsearch_http_port: 9200
 elasticsearch_script_inline: true
 elasticsearch_script_indexed: true
+elasticsearch_version: 2.x
diff --git a/provisioning/roles/geerlingguy.elasticsearch/tasks/setup-Debian.yml b/provisioning/roles/geerlingguy.elasticsearch/tasks/setup-Debian.yml
index bafa0d5..ef4b4e0 100644
--- a/provisioning/roles/geerlingguy.elasticsearch/tasks/setup-Debian.yml
+++ b/provisioning/roles/geerlingguy.elasticsearch/tasks/setup-Debian.yml
@@ -4,11 +4,19 @@
     url: https://packages.elastic.co/GPG-KEY-elasticsearch
     state: present

-- name: Add Elasticsearch repository.
+- name: Add Elasticsearch repository.(2.x)
   apt_repository:
     repo: 'deb http://packages.elastic.co/elasticsearch/2.x/debian stable main'
     state: present
     update_cache: yes
+  when: elasticsearch_version == '2.x'
+
+- name: Add Elasticsearch repository.(1.4)
+  apt_repository:
+    repo: 'deb http://packages.elastic.co/elasticsearch/1.4/debian stable main'
+    state: present
+    update_cache: yes
+  when: elasticsearch_version == '1.4'

 - name: Install Elasticsearch.
   apt: pkg=elasticsearch state=present
davidak commented 7 years ago

1.7 was EOL on 2017-01-16.

Source: https://www.elastic.co/support/eol

But you should support the current stable version 5.x.

geerlingguy commented 7 years ago

Yeah, definitely. I'm trying to get that done ASAP, maybe by end of day today!

But definitely not planning on supporting 1.x further—if someone really needs it, they can use an older role version at this point.