aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_5_setup_elasticsearch.rb
blob: 44e96f34779f2dc26b13384a141c32b29338f275 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
clusterName = node['elasticsearch'][:cluster_name]+node.chef_environment

elasticsearch_list = ''

node['Nodes']['ES'].each  do |item|
    elasticsearch_list += "- " + item + ":9300\n"
end



template "elasticsearch.yml-config" do
  path "#{ENV['JETTY_BASE']}/config/elasticsearch.yml"
  source "BE-elasticsearch.yml.erb"
  owner "#{ENV['JETTY_USER']}"
  group "#{ENV['JETTY_GROUP']}"
  mode "0755"
  variables ({
    :cluster_name => "#{clusterName}",
    :es_host_ip => "#{elasticsearch_list}"
  })
end