diff --git a/recipes/default.rb b/recipes/default.rb index b200441cc..596b3e6ed 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -6,7 +6,7 @@ Chef::Log.debug "Installation mode #{node[:elasticsearch][:installation][:mode]}" -if node.elasticsearch[:esmajor] >= 5 +if node.elasticsearch[:esmajor].to_i >= 5 default.elasticsearch[:bootstrap][:memory_lock] = node.elasticsearch[:bootstrap][:mlockall] if node.elasticsearch[:limits][:nofile] < 65536 default.elasticsearch[:limits][:nofile] = 65536 diff --git a/templates/default/elasticsearch.yml.erb b/templates/default/elasticsearch.yml.erb index 7c99f6975..5d3524e5d 100644 --- a/templates/default/elasticsearch.yml.erb +++ b/templates/default/elasticsearch.yml.erb @@ -32,7 +32,7 @@ <%= print_value 'index.number_of_replicas' -%> <%= print_value 'index.auto_expand_replicas' -%> <%= print_value 'action.auto_create_index' -%> -<% if node.elasticsearch[:esmajor] < 1 %> +<% if node.elasticsearch[:esmajor].to_i < 1 %> <%= print_value 'action.disable_delete_all_indices' -%> <% else %> <%= print_value 'action.destructive_requires_name' -%> @@ -54,7 +54,7 @@ ################################### Memory #################################### -<% if node.elasticsearch[:esmajor] < 5 %> +<% if node.elasticsearch[:esmajor].to_i < 5 %> <%= print_value 'bootstrap.mlockall' -%> <% else %> <%= print_value 'bootstrap.memory_lock' -%> @@ -135,7 +135,7 @@ discovery.ec2.tag.<%= key %>: <%= value %> ################################## Slow Log ################################### -<% if node.elasticsearch[:esmajor] < 5 %> +<% if node.elasticsearch[:esmajor].to_i < 5 %> <%= print_value 'index.mapper.dynamic' -%> <%= print_value 'index.search.slowlog.threshold.query.warn' -%> <%= print_value 'index.search.slowlog.threshold.query.info' -%>