aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_5_setup_elasticsearch.rb
blob: 7a2f24e57a3beda67cf49ec0b0dc0fc90d1ac61f (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 "jetty"
  group "jetty"
  mode "0755"
  variables ({
    :cluster_name => "#{clusterName}",
    :es_host_ip => "#{elasticsearch_list}"
  })
end