Update elasticsearch to 2.x on ridley
authorTom Hughes <tom@compton.nu>
Fri, 17 Feb 2017 14:51:52 +0000 (14:51 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 17 Feb 2017 14:51:52 +0000 (14:51 +0000)
cookbooks/apt/recipes/default.rb
cookbooks/elasticsearch/attributes/default.rb
cookbooks/elasticsearch/templates/default/elasticsearch.yml.erb
roles/elasticsearch.rb
roles/foundation.rb

index 57c279cd68565668071c9a7dbdc5a49725471c6c..06edb02a05afdece6beb2b4e68cb6dd106329066 100644 (file)
@@ -96,12 +96,18 @@ apt_source "nginx" do
   key "ABF5BD827BD9BF62"
 end
 
-apt_source "elasticsearch" do
+apt_source "elasticsearch1.7" do
   source_template "elasticsearch.list.erb"
   url "http://packages.elasticsearch.org/elasticsearch/1.7/debian"
   key "D27D666CD88E42B4"
 end
 
+apt_source "elasticsearch2.x" do
+  source_template "elasticsearch.list.erb"
+  url "http://packages.elasticsearch.org/elasticsearch/2.x/debian"
+  key "D27D666CD88E42B4"
+end
+
 apt_source "logstash" do
   source_template "elasticsearch.list.erb"
   url "http://packages.elasticsearch.org/logstash/2.3/debian"
index d3f6707c22f67b97e0cdddaff306698fd39216ff..45d59a2b58ac16f8fb4a169f7f33120b7379bdc7 100644 (file)
@@ -1,4 +1,7 @@
+default[:elasticsearch][:version] = "1.7"
 default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:low] = "85%"
 default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:high] = "90%"
 default[:elasticsearch][:script][:disable_dynamic] = true
 default[:elasticsearch][:path][:data] = "/var/lib/elasticsearch"
+
+default[:apt][:sources] |= ["elasticsearch#{node[:elasticsearch][:version]}"]
index f9d8ebf758f6b344f754532b36f00020eaacdfde..ea04ea99ace24a3ea8de811afd6954314256a83d 100644 (file)
@@ -5,4 +5,6 @@ cluster.routing.allocation.disk.watermark.low: <%= node[:elasticsearch][:cluster
 cluster.routing.allocation.disk.watermark.high: <%= node[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:high] %>
 network.host: 127.0.0.1
 path.data: <%= node[:elasticsearch][:path][:data] %>
+<% if node[:elasticsearch][:script][:disable_dynamic] -%>
 script.disable_dynamic: <%= node[:elasticsearch][:script][:disable_dynamic] -%>
+<% end -%>
index ae0e2b6cc5491fe8ca5e31ed6a996a9739b8160c..59dcef23a2db100bb29707cff2d18e64b053da77 100644 (file)
@@ -1,12 +1,6 @@
 name "elasticsearch"
 description "Role applied to all elasticsearch servers"
 
-default_attributes(
-  :apt => {
-    :sources => ["elasticsearch"]
-  }
-)
-
 run_list(
   "recipe[elasticsearch]"
 )
index 338d1ab4cbd5174992fdab88c55701e617929481..22f8dc3eb0f52ee170fc21cf9254b6a0168bdb7e 100644 (file)
@@ -11,6 +11,7 @@ default_attributes(
     :sources => ["passenger", "brightbox-ruby-ng"]
   },
   :elasticsearch => {
+    :version => "2.x",
     :cluster => {
       :name => "foundation"
     },